Skip to content

Commit 481e9e8

Browse files
committed
add integration tests
1 parent 9224dec commit 481e9e8

File tree

5 files changed

+15448
-10544
lines changed

5 files changed

+15448
-10544
lines changed

integration_tests/create_database.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//@ts-check
22
import {describe, expect, test, beforeAll} from '@jest/globals';
33
//import WOQLClient from '../lib/woqlClient';
4-
import {WOQLClient} from '@terminusdb/terminusdb-client';
5-
import { DbDetails, DocParamsGet } from '@terminusdb/terminusdb-client/dist/typescript/lib/typedef';
4+
import {WOQLClient} from '../index.js';
5+
import { DbDetails, DocParamsGet } from '../dist/typescript/lib/typedef';
66
//import {ParamsObj,DbDetails} from '../lib/typedef';
77
import schemaJson from './persons_schema'
88
//console.log(typeof schemaJson)

integration_tests/persons_schema.ts

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
const schema: object = [
2+
{
3+
"@base": "terminusdb:///data/",
4+
"@schema": "terminusdb:///schema#",
5+
"@type": "@context"
6+
},
7+
{
8+
"@id": "Child",
9+
"@inherits": "Person",
10+
"@key": {
11+
"@fields": [
12+
"name"
13+
],
14+
"@type": "Lexical"
15+
},
16+
"@type": "Class"
17+
},
18+
{
19+
"@id": "Person",
20+
"@key": {
21+
"@fields": [
22+
"name"
23+
],
24+
"@type": "Lexical"
25+
},
26+
"@type": "Class",
27+
"age": {
28+
"@class": "xsd:decimal",
29+
"@type": "Optional"
30+
},
31+
"has_parent": {
32+
"@class": "Parent",
33+
"@type": "Optional"
34+
},
35+
"name": {
36+
"@class": "xsd:string",
37+
"@type": "Optional"
38+
}
39+
},
40+
{
41+
"@id": "Parent",
42+
"@inherits": "Person",
43+
"@key":{
44+
"@fields": [
45+
"name"
46+
],
47+
"@type": "Lexical"
48+
},
49+
"@type": "Class",
50+
"has_child": {
51+
"@class": "Child",
52+
"@type": "Optional"
53+
}
54+
}
55+
]
56+
57+
export default schema

jest.config.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*/
55

66
module.exports = {
7-
"testResultsProcessor": "./node_modules/jest-html-reporter",
8-
97
// All imported modules in your tests should be mocked automatically
108
// automock: false,
119

@@ -156,7 +154,7 @@ module.exports = {
156154
// testLocationInResults: false,
157155

158156
// The glob patterns Jest uses to detect test files
159-
"testMatch": ["<rootDir>/integration_test/*.test.ts"],
157+
"testMatch": ["<rootDir>/integration_tests/*.test.ts"],
160158

161159
// testMatch: [
162160
// "**/__tests__/**/*.[jt]s?(x)",

0 commit comments

Comments
 (0)