forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: implement test in memory execution based on TS aliases (micros…
…oft#17161) * chore(react-menu): implement in memory test execution * fix(react-conformance): remove esModuleInterop so the package is compliant with other packages * fix(utilities): make pkg compile in strict mode * chore(make-styles): propagate deps to root and remove path overrides so the package can be properly consumed by ts path aliases converged packages * chore(react-menu): add global types from dependant packages until we properly define globals type resolution for all * chore: remove packages from path aliases that have been removed from convergence * Change files
- Loading branch information
1 parent
6522e67
commit 5d627b7
Showing
28 changed files
with
147 additions
and
63 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 |
---|---|---|
|
@@ -65,6 +65,7 @@ coverage | |
dist | ||
dist-storybook | ||
screenshots | ||
.cache | ||
|
||
*.tar.gz | ||
|
||
|
7 changes: 7 additions & 0 deletions
7
change/@fluentui-make-styles-d676c107-849e-4666-9f1a-8543ea276f74.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,7 @@ | ||
{ | ||
"type": "none", | ||
"comment": "chore(make-styles): propagate deps to root and remove path overrides so the package can be properly consumed by ts path aliases converged packages", | ||
"packageName": "@fluentui/make-styles", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-conformance-d1983716-7e77-4f5e-b372-01cced6fae24.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,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "fix(react-conformance): remove esModuleInterop so the package is compliant with other packages", | ||
"packageName": "@fluentui/react-conformance", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-menu-ce828c95-56eb-4e5b-a86d-668aad9f140f.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,7 @@ | ||
{ | ||
"type": "none", | ||
"comment": "chore(react-menu): implement in memory test exection", | ||
"packageName": "@fluentui/react-menu", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-utilities-4903da1e-6768-4ac6-8a5e-96f518dd859a.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,7 @@ | ||
{ | ||
"type": "none", | ||
"comment": "fix(utilities): make pkg compile in strict mode", | ||
"packageName": "@fluentui/utilities", | ||
"email": "[email protected]", | ||
"dependentChangeType": "none" | ||
} |
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 @@ | ||
module.exports = { | ||
projects: ['<rootDir>/packages/react-menu'], | ||
}; |
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,28 @@ | ||
// @ts-check | ||
|
||
const path = require('path'); | ||
const { pathsToModuleNameMapper } = require('ts-jest/utils'); | ||
|
||
const tsConfig = require('./tsconfig.base.json'); | ||
|
||
const tsPathAliases = pathsToModuleNameMapper(tsConfig.compilerOptions.paths, { | ||
prefix: `<rootDir>/${path.relative(process.cwd(), __dirname)}/`, | ||
}); | ||
|
||
/** | ||
* @type {jest.InitialOptions} | ||
*/ | ||
const baseConfig = { | ||
transform: { | ||
'^.+\\.ts$': 'ts-jest', | ||
}, | ||
testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'], | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], | ||
testPathIgnorePatterns: ['/node_modules/', '/lib/', '/lib-commonjs/', '/dist/'], | ||
moduleNameMapper: { ...tsPathAliases }, | ||
cacheDirectory: '<rootDir>/.cache/jest', | ||
clearMocks: true, | ||
watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'], | ||
}; | ||
|
||
module.exports = { ...baseConfig }; |
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
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,20 @@ | ||
const { createConfig, resolveMergeStylesSerializer } = require('@fluentui/scripts/jest/jest-resources'); | ||
const path = require('path'); | ||
// @ts-check | ||
|
||
const config = createConfig({ | ||
setupFiles: [path.resolve(path.join(__dirname, 'config', 'tests.js'))], | ||
snapshotSerializers: [resolveMergeStylesSerializer()], | ||
}); | ||
|
||
module.exports = config; | ||
/** | ||
* @type {jest.InitialOptions} | ||
*/ | ||
module.exports = { | ||
displayName: 'react-menu', | ||
preset: '../../jest.preset.js', | ||
globals: { | ||
'ts-jest': { | ||
tsConfig: '<rootDir>/tsconfig.json', | ||
diagnostics: false, | ||
}, | ||
}, | ||
transform: { | ||
'^.+\\.tsx?$': 'ts-jest', | ||
}, | ||
coverageDirectory: './coverage', | ||
setupFilesAfterEnv: ['./config/tests.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
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
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
Oops, something went wrong.