Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wesone/blackrik
Browse files Browse the repository at this point in the history
  • Loading branch information
wesone committed May 5, 2021
2 parents faf21d3 + 95dfa7a commit dcb8e1b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions test/adapters/readmodelstore-mysql/Integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,47 @@ test('position check handling', async () => {
expect(result).toEqual(expectedResult);

});

test('disconnect', async () => {

const schema = {
id: {
type: 'number'
},
myJSON: {
type: 'json',
}
};

await adapter.dropTable(tableName);

await adapter.disconnect();

await adapter.defineTable(tableName, schema);

await adapter.disconnect();

await Promise.all([ adapter.findOne(tableName), adapter.findOne(tableName)]);

await adapter.disconnect();

await adapter.insert(tableName, {
id: 1,
myJSON: {text: 'Hello World!'},
});

await adapter.disconnect();

await adapter.insert(tableName, {
id: 2,
myJSON: ['Hello', 'World', '!'],
});

const result = await adapter.count(tableName);
expect(result).toEqual(2);

await adapter.disconnect();

expect(adapter.connection).toEqual(null);

});

0 comments on commit dcb8e1b

Please sign in to comment.