-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring Jest up to the root of lerna (#145)
Ran all tests locally to confirm they all pass since new PRs and pushes to main will only run tests affected by changes. To run all tests in the future for other actions, we can just use `npm run test:ci`
- Loading branch information
1 parent
a0d38da
commit 577f75b
Showing
74 changed files
with
21,814 additions
and
101,320 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
File renamed without changes.
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 @@ | ||
module.exports = 'test-file-stub'; |
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,2 @@ | ||
// An empty mock for all the feature imports we need from monaco | ||
// Used from the `moduleNameMapper` section in package.json |
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,3 @@ | ||
import monaco from '../packages/mocks/monaco-editor'; | ||
|
||
module.exports = monaco; |
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,9 +1,13 @@ | ||
module.exports = { | ||
presets: ['@deephaven/babel-preset'], | ||
ignore: [ | ||
/\.test.(tsx?|jsx?)$/, | ||
/\.stories.(tsx?|jsx?|mdx?)$/, | ||
'**/__mocks__/*', | ||
'**/*.scss', | ||
], | ||
module.exports = api => { | ||
const isTest = api.env('test'); | ||
return { | ||
presets: ['@deephaven/babel-preset'], | ||
babelrcRoots: ['.', 'packages/*'], | ||
ignore: [ | ||
!isTest ? /\.test.(tsx?|jsx?)$/ : false, | ||
!isTest ? '**/__mocks__/*' : false, | ||
/\.stories.(tsx?|jsx?|mdx?)$/, | ||
'**/*.scss', | ||
].filter(Boolean), | ||
}; | ||
}; |
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,7 @@ | ||
module.exports = { | ||
cliOptions: { | ||
maxWarnings: 0, | ||
cache: true, | ||
cacheStrategy: 'content', | ||
}, | ||
}; |
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,25 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
transform: { | ||
// In CI, we don't need the tests to type check, so use babel-jest | ||
// In non-CI (locally), use ts-jest so tests fail on type errors | ||
'.(ts|tsx|js|jsx)': process.env.CI ? 'babel-jest' : 'ts-jest', | ||
}, | ||
moduleNameMapper: { | ||
'\\.(css|less|scss|sass)$': 'identity-obj-proxy', | ||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': path.join( | ||
__dirname, | ||
'./__mocks__/fileMock.js' | ||
), | ||
'^monaco-editor/esm/vs/editor/editor.api$': path.join( | ||
__dirname, | ||
'./__mocks__/monaco-editor.js' | ||
), | ||
'^monaco-editor/esm/vs/editor/(.*)': path.join( | ||
__dirname, | ||
'./__mocks__/monaco-editor-empty.js' | ||
), | ||
}, | ||
setupFilesAfterEnv: [path.join(__dirname, './jest.setup.js')], | ||
}; |
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,24 @@ | ||
module.exports = { | ||
projects: [ | ||
{ | ||
displayName: 'eslint', | ||
runner: 'jest-runner-eslint', | ||
testMatch: ['<rootDir>/packages/*/src/**/*.{js,jsx,ts,tsx}'], | ||
}, | ||
{ | ||
displayName: 'stylelint', | ||
runner: 'jest-runner-stylelint', | ||
testMatch: ['<rootDir>/packages/*/src/**/*.scss'], | ||
moduleFileExtensions: ['scss'], | ||
}, | ||
'<rootDir>/packages/*/jest.config.js', | ||
], | ||
watchPlugins: [ | ||
'jest-watch-typeahead/filename', | ||
'jest-watch-typeahead/testname', | ||
'jest-watch-select-projects', | ||
], | ||
collectCoverage: false, | ||
coverageDirectory: '<rootDir>/coverage/', // This is relative to monorepo root | ||
collectCoverageFrom: ['./src/**/*.{js,ts,jsx,tsx}'], // This is relative to individual project root due to how Jest handles it | ||
}; |
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
Oops, something went wrong.