-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] Suport helpers for long tests triggering
- Loading branch information
1 parent
6663fa3
commit dff4698
Showing
18 changed files
with
109 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
const baseJestConfig = require('./jest/jest.config.base.js'); | ||
module.exports = { | ||
...baseJestConfig, | ||
transform: { | ||
'^.+\\.test.ts?$': [ | ||
'ts-jest', | ||
{ tsconfig: './tests/tsconfig.json' }, | ||
], | ||
}, | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
testMatch: [ | ||
"<rootDir>/tests/**/*.test.ts" | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// jest-globals.d.ts | ||
declare global { | ||
function describeLongTest(name: string, fn: () => void): void; | ||
namespace describeLongTest { | ||
var skip: (name: string, fn: () => void) => void; | ||
} | ||
} | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const path = require('path'); | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
setupFilesAfterEnv: [path.resolve(__dirname, 'jest.setup.js')], | ||
detectOpenHandles: true, | ||
testMatch: [ | ||
"<rootDir>/**/*.test.ts" | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
global.describeLongTest = (name, fn) => { | ||
if (process.env.LONG_TESTS === "true") { | ||
describe(name, fn); | ||
} | ||
}; | ||
|
||
global.describeLongTest.skip = (name, fn) => { | ||
describe.skip(name, fn); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
const path = require('path'); | ||
module.exports = { | ||
preset: "ts-jest", | ||
testEnvironment: "node" | ||
testEnvironment: "node", | ||
setupFilesAfterEnv: [path.resolve(__dirname, 'jest', 'jest.setup.js')], | ||
detectOpenHandles: true, | ||
testMatch: [ | ||
"<rootDir>/**/*.test.ts" | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// jest-globals.d.ts | ||
declare global { | ||
function describeLongTest(name: string, fn: () => void): void; | ||
namespace describeLongTest { | ||
var skip: (name: string, fn: () => void) => void; | ||
} | ||
} | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
global.describeLongTest = (name, fn) => { | ||
if (process.env.LONG_TESTS === "true") { | ||
describe(name, fn); | ||
} | ||
}; | ||
|
||
global.describeLongTest.skip = (name, fn) => { | ||
describe.skip(name, fn); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
const path = require('path'); | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node' | ||
preset: "ts-jest", | ||
testEnvironment: "node", | ||
setupFilesAfterEnv: [path.resolve(__dirname, "jest", 'jest.setup.js')], | ||
detectOpenHandles: true, | ||
testMatch: [ | ||
"<rootDir>/**/*.test.ts" | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// jest-globals.d.ts | ||
declare global { | ||
function describeLongTest(name: string, fn: () => void): void; | ||
namespace describeLongTest { | ||
var skip: (name: string, fn: () => void) => void; | ||
} | ||
} | ||
|
||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
global.describeLongTest = (name, fn) => { | ||
if (process.env.LONG_TESTS === "true") { | ||
describe(name, fn); | ||
} | ||
}; | ||
|
||
global.describeLongTest.skip = (name, fn) => { | ||
describe.skip(name, fn); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,6 @@ | |
"include": [ | ||
"**/*.ts", | ||
"**/*.tsx", | ||
"jest/jest-globals.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters