File tree 7 files changed +69
-13
lines changed
7 files changed +69
-13
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " @commitlint/test-environment" ,
3
+ "version" : " 8.3.5" ,
4
+ "description" : " test environment for @commitlint" ,
5
+ "main" : " lib/test-environment.js" ,
6
+ "types" : " lib/test-environment.d.ts" ,
7
+ "files" : [
8
+ " lib/"
9
+ ],
10
+ "engines" : {
11
+ "node" : " >=8"
12
+ },
13
+ "repository" : {
14
+ "type" : " git" ,
15
+ "url" : " https://github.com/conventional-changelog/commitlint.git"
16
+ },
17
+ "bugs" : {
18
+ "url" : " https://github.com/conventional-changelog/commitlint/issues"
19
+ },
20
+ "homepage" : " https://github.com/conventional-changelog/commitlint#readme" ,
21
+ "keywords" : [
22
+ " conventional-changelog" ,
23
+ " commitlint" ,
24
+ " test" ,
25
+ " cli"
26
+ ],
27
+ "license" : " MIT" ,
28
+ "dependencies" : {
29
+ "@types/tmp" : " ^0.1.0" ,
30
+ "tmp" : " 0.1.0"
31
+ }
32
+ }
Original file line number Diff line number Diff line change
1
+ // https://github.com/raszi/node-tmp/issues/229
2
+ import NodeEnvironment from 'jest-environment-node' ;
3
+ import tmp from 'tmp' ;
4
+
5
+ class TestEnvironment extends NodeEnvironment {
6
+ async setup ( ) {
7
+ await super . setup ( ) ;
8
+
9
+ tmp . setGracefulCleanup ( ) ;
10
+
11
+ this . global . tmp = tmp ;
12
+ }
13
+ }
14
+
15
+ export default TestEnvironment ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "extends" : " ../../tsconfig.shared.json" ,
3
+ "compilerOptions" : {
4
+ "composite" : true ,
5
+ "rootDir" : " ./src" ,
6
+ "outDir" : " ./lib"
7
+ },
8
+ "include" : [
9
+ " ./src/**/*.ts"
10
+ ],
11
+ "exclude" : [
12
+ " ./src/**/*.test.ts" ,
13
+ " ./lib/**/*"
14
+ ]
15
+ }
Original file line number Diff line number Diff line change 1
- import tmp from 'tmp' ;
2
1
import fs from 'fs-extra' ;
3
2
import path from 'path' ;
4
3
import pkgDir from 'pkg-dir' ;
5
4
5
+ declare global {
6
+ var tmp : typeof import ( 'tmp' ) ;
7
+ }
8
+
6
9
export async function bootstrap ( fixture ?: string , directory ?: string ) {
7
10
const tmpDir = tmp . dirSync ( {
8
11
keep : false ,
Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
preset : 'ts-jest/presets/js-with-babel' ,
3
- testEnvironment : 'node ' ,
3
+ testEnvironment : '@commitlint/test-environment ' ,
4
4
testRegex : undefined ,
5
5
testMatch : [
6
6
'**/*.test.ts?(x)' ,
Original file line number Diff line number Diff line change 3
3
"include" : [],
4
4
"extends" : " ./tsconfig.shared.json" ,
5
5
"references" : [
6
+ { "path" : " @packages/test-environment" },
6
7
{ "path" : " @packages/test" },
7
8
{ "path" : " @commitlint/ensure" },
8
9
{ "path" : " @commitlint/execute-rule" },
Original file line number Diff line number Diff line change 2036
2036
resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
2037
2037
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==
2038
2038
2039
- " @types/node@* " :
2040
- version "12.0.2"
2041
- resolved "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz#3452a24edf9fea138b48fad4a0a028a683da1e40"
2042
- integrity sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==
2043
-
2044
-
2039
+ " @types/node@*" , "@types/[email protected] ", "@types/node@>= 8":
2045
2040
version "12.12.26"
2046
2041
resolved "https://registry.npmjs.org/@types/node/-/node-12.12.26.tgz#213e153babac0ed169d44a6d919501e68f59dea9"
2047
2042
integrity sha512-UmUm94/QZvU5xLcUlNR8hA7Ac+fGpO1EG/a8bcWVz0P0LqtxFmun9Y2bbtuckwGboWJIT70DoWq1r3hb56n3DA==
2048
2043
2049
- " @types/node@>= 8 " :
2050
- version "13.5.0"
2051
- resolved "https://registry.npmjs.org/@types/node/-/node-13.5.0.tgz#4e498dbf355795a611a87ae5ef811a8660d42662"
2052
- integrity sha512-Onhn+z72D2O2Pb2ql2xukJ55rglumsVo1H6Fmyi8mlU9SvKdBk/pUSUAiBY/d9bAOF7VVWajX3sths/+g6ZiAQ==
2053
-
2054
2044
" @types/normalize-package-data@^2.4.0 " :
2055
2045
version "2.4.0"
2056
2046
resolved "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
You can’t perform that action at this time.
0 commit comments