-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(v0): enable emit only dts and use new conformance test API to n…
…arrow down TS Program (#27686) * chore(v0): emit dts only for v0 which uses babel for transpilation * test(react-norhtstar): use new conformance api to narrow down ts program to speed up tests * feat(scripts-jest): clear and restore mocks automatically to prevent accidental test leaks * test(react-northstar): scope fake timers usage
- Loading branch information
Showing
13 changed files
with
46 additions
and
31 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
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,13 +1,25 @@ | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const { workspaceRoot } = require('@nrwl/devkit'); | ||
const { pathsToModuleNameMapper } = require('ts-jest'); | ||
const { createV0Config: commonConfig } = require('@fluentui/scripts-jest'); | ||
|
||
const config = commonConfig({ | ||
name: 'react', | ||
displayName: 'react-northstar', | ||
moduleNameMapper: { | ||
// Legacy aliases, they should not be used in new tests | ||
'^src/(.*)$': `<rootDir>/src/$1`, | ||
'test/(.*)$': `<rootDir>/test/$1`, | ||
...getAliases(), | ||
}, | ||
}); | ||
config.setupFilesAfterEnv = [...config.setupFilesAfterEnv, './jest-setup.js']; | ||
|
||
module.exports = config; | ||
|
||
function getAliases() { | ||
const tsConfig = JSON.parse(fs.readFileSync(path.join(__dirname, 'tsconfig.spec.json'))); | ||
const tsPathAliases = pathsToModuleNameMapper(tsConfig.compilerOptions.paths, { | ||
prefix: `<rootDir>/${path.relative(__dirname, workspaceRoot)}/`, | ||
}); | ||
|
||
return tsPathAliases; | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/fluentui/react-northstar/test/specs/commonTests/extraConformanceTests.tsx
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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"emitDeclarationOnly": false, | ||
"composite": false, | ||
"types": ["node", "jest", "@testing-library/jest-dom"], | ||
"paths": { | ||
"src/*": ["packages/fluentui/react-northstar/src/*"], | ||
"test/*": ["packages/fluentui/react-northstar/test/*"] | ||
} | ||
}, | ||
"include": ["test"] | ||
} |
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