forked from typeorm/typeorm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
typeorm#799 sqlite: The 'database' path will now be created
- Loading branch information
1 parent
82a0be7
commit dd920f2
Showing
4 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ node_modules/ | |
ormconfig.json | ||
ormlogs.log | ||
npm-debug.log | ||
/test/github-issues/799/tmp/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import "reflect-metadata"; | ||
import * as assert from "assert"; | ||
import {createConnection} from "../../../src/index"; | ||
import * as rimraf from "rimraf"; | ||
import {dirname} from "path"; | ||
|
||
describe("github issues > #799 sqlite: 'database' path should be created", () => { | ||
|
||
const path = `${__dirname}/tmp/sqlitedb.db`; | ||
const cleanup = (done: () => void) => { | ||
rimraf(dirname(path), () => { | ||
return done(); | ||
}); | ||
}; | ||
|
||
before(cleanup); | ||
after(cleanup); | ||
|
||
it("should create the whole path to database file", async function () { | ||
const connection = await createConnection({ | ||
"name": "sqlite", | ||
"type": "sqlite", | ||
"database": path | ||
}); | ||
|
||
assert.strictEqual(connection.isConnected, true); | ||
}); | ||
|
||
}); |