Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
fix: #72 error
Browse files Browse the repository at this point in the history
  • Loading branch information
Soontao committed Sep 21, 2020
1 parent 921e759 commit 7e7accd
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
32 changes: 32 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
},
"devDependencies": {
"@odata/client": "^2.10.2",
"@sap/hana-client": "^2.5.109",
"@types/body-parser": "1.19.0",
"@types/cors": "^2.8.7",
"@types/debug": "^4.1.5",
Expand All @@ -78,6 +79,7 @@
"eslint": "^7.9.0",
"eslint-plugin-es-beautifier": "^1.0.1",
"event-stream": "^4.0.1",
"hdb-pool": "^0.1.6",
"jest": "^26.4.2",
"mongodb": "^3.6.2",
"pg": "^8.3.3",
Expand Down
16 changes: 15 additions & 1 deletion test/type/migrate.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,21 @@ describe('Server Test Suite', () => {

const { services: [v1Service] } = await server.getServicesWithNewContext(MigrateTable1);

await expect(() => v1Service.create({ value: 'test' })).rejects.toThrow(QueryFailedError); // table not found
switch (opt.type) {
case 'sap':
try {
await v1Service.create({ value: 'test' });
expect(true).toBeFalsy(); // must throw error
} catch (error) {
expect(error).not.toBeUndefined();
}
break;
default:
await expect(() => v1Service.create({ value: 'test' })).rejects.toThrow(QueryFailedError);
break;
}

await server.getConnection().close();

});

Expand Down

0 comments on commit 7e7accd

Please sign in to comment.