File tree Expand file tree Collapse file tree 7 files changed +69
-13
lines changed
Expand file tree Collapse file tree 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' ;
21import fs from 'fs-extra' ;
32import path from 'path' ;
43import pkgDir from 'pkg-dir' ;
54
5+ declare global {
6+ var tmp : typeof import ( 'tmp' ) ;
7+ }
8+
69export async function bootstrap ( fixture ?: string , directory ?: string ) {
710 const tmpDir = tmp . dirSync ( {
811 keep : false ,
Original file line number Diff line number Diff line change 11module . exports = {
22 preset : 'ts-jest/presets/js-with-babel' ,
3- testEnvironment : 'node ' ,
3+ testEnvironment : '@commitlint/test-environment ' ,
44 testRegex : undefined ,
55 testMatch : [
66 '**/*.test.ts?(x)' ,
Original file line number Diff line number Diff line change 33 "include" : [],
44 "extends" : " ./tsconfig.shared.json" ,
55 "references" : [
6+ { "path" : " @packages/test-environment" },
67 { "path" : " @packages/test" },
78 { "path" : " @commitlint/ensure" },
89 { "path" : " @commitlint/execute-rule" },
Original file line number Diff line number Diff line change 20362036 resolved "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
20372037 integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==
20382038
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- " @types/node@12.12.26 " :
2039+ " @types/node@*" , "@types/node@12.12.26", "@types/node@>= 8":
20452040 version "12.12.26"
20462041 resolved "https://registry.npmjs.org/@types/node/-/node-12.12.26.tgz#213e153babac0ed169d44a6d919501e68f59dea9"
20472042 integrity sha512-UmUm94/QZvU5xLcUlNR8hA7Ac+fGpO1EG/a8bcWVz0P0LqtxFmun9Y2bbtuckwGboWJIT70DoWq1r3hb56n3DA==
20482043
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-
20542044" @types/normalize-package-data@^2.4.0 " :
20552045 version "2.4.0"
20562046 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