Skip to content

Commit

Permalink
add enable-wal test
Browse files Browse the repository at this point in the history
  • Loading branch information
imnotjames committed Sep 11, 2020
1 parent 1801105 commit 37da748
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/functional/sqlite/enable-wal.ts
@@ -0,0 +1,24 @@
import "reflect-metadata";
import {expect} from "chai";
import {Connection} from "../../../src/connection/Connection";
import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../utils/test-utils";

describe("sqlite driver > enable wal", () => {
let connections: Connection[];
before(async () => connections = await createTestingConnections({
entities: [],
enabledDrivers: ["sqlite"],
driverSpecific: {
enableWAL: true
}
}));
beforeEach(() => reloadTestingDatabases(connections));
after(() => closeTestingConnections(connections));

it("should set the journal mode as expected", () => Promise.all(connections.map(async connection => {
// if we come this far, test was successful as a connection was established
const result = await connection.query('PRAGMA journal_mode');

expect(result).to.eql([{ journal_mode: 'wal'}]);
})));
});

0 comments on commit 37da748

Please sign in to comment.