Skip to content

Commit cf20a3f

Browse files
committed
test: improve tests
1 parent 1bd5b5d commit cf20a3f

File tree

13 files changed

+5153
-769
lines changed

13 files changed

+5153
-769
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
lib
22
node_modules
3-
tests/out/
3+
tests/__result/

package-lock.json

Lines changed: 5104 additions & 753 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,27 @@
3737
"build": "tsc",
3838
"prepare": "npm run build",
3939
"release": "standard-version",
40-
"test": "./test.sh"
40+
"pretest": "npm run build && rm -rf tests/__result",
41+
"test-original": "tsc -p tests/__fixtures/tsconfig.json --outDir tests/__result/original",
42+
"test-generated": "ttsc -p tests/__fixtures/tsconfig.json --outDir tests/__result/generated",
43+
"test": "npm run test-original && npm run test-generated && node tests/__result/generated/core/index.js && jest"
44+
},
45+
"jest": {
46+
"preset": "ts-jest",
47+
"testEnvironment": "node",
48+
"testMatch": ["**/tests/index.ts"]
4149
},
4250
"dependencies": {
4351
"slash": "^3.0.0"
4452
},
4553
"devDependencies": {
54+
"@types/fs-readdir-recursive": "^1.0.0",
55+
"@types/jest": "^24.0.15",
4656
"@types/node": "^12.0.2",
57+
"fs-readdir-recursive": "^1.1.0",
58+
"jest": "^24.8.0",
4759
"standard-version": "^6.0.1",
60+
"ts-jest": "^24.0.2",
4861
"ttypescript": "^1.5.6",
4962
"typescript": "^3.4.5"
5063
}

test.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.

tests/tsconfig.json renamed to tests/__fixtures/tsconfig.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"strict": true,
77

88
"declaration": true,
9-
"outDir": "out/",
109
"baseUrl": "./",
1110
"paths": {
1211
"@*": ["*"]
@@ -15,8 +14,8 @@
1514
"esModuleInterop": true,
1615

1716
"plugins": [
18-
{ "transform": "../" },
19-
{ "transform": "../", "afterDeclarations": true }
17+
{ "transform": "../../" },
18+
{ "transform": "../../", "afterDeclarations": true }
2019
]
2120
}
2221
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)