-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
This reverts commit d9acd80.
- Loading branch information
Showing
14 changed files
with
1,210 additions
and
123 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const createTransformer = require( 'babel-jest' ).default.createTransformer; | ||
|
||
module.exports = createTransformer( { | ||
presets: [ '@wordpress/babel-preset-default', '@babel/preset-typescript' ], | ||
} ); |
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 +1,3 @@ | ||
import '@testing-library/jest-dom/extend-expect'; | ||
|
||
jest.mock( 'a8c-fse-common-data-stores', () => {}, { virtual: true } ); |
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,37 @@ | ||
module.exports = { | ||
preset: '../../test/apps/jest-preset.js', | ||
setupFilesAfterEnv: [ require.resolve( './bin/js-unit-setup' ) ], | ||
/** | ||
* Test configuration for the FSE plugin. | ||
* | ||
* Will match files such that: | ||
* 1. Must be in the apps/editing-toolkit/ directory | ||
* 2. Must have .test.EXT at the end of the filename | ||
* 3. EXT (above) must be one of js, ts, jsx, or tsx. | ||
* | ||
* Note: In order to use a different jest config for e2e tests, this config file | ||
* must be kept in the bin/ folder to prevent it from being detected as the | ||
* config file for e2e tests. | ||
*/ | ||
|
||
const path = require( 'path' ); | ||
const base = require( '@automattic/calypso-jest' ); | ||
// @wordpress/scripts manually adds additional Jest config ontop of | ||
// @wordpress/jest-preset-default so we pull in this file to extend it | ||
const defaults = require( '@wordpress/scripts/config/jest-unit.config.js' ); | ||
|
||
// Basically, CWD, so 'apps/editing-toolkit'. | ||
// Without this, it tries to use 'apps/editing-toolkit/bin' | ||
const pluginRoot = path.resolve( './' ); | ||
|
||
const config = { | ||
...base, | ||
...defaults, | ||
rootDir: path.normalize( '../../' ), // To detect wp-calypso root node_modules | ||
testMatch: [ `${ pluginRoot }/**/?(*.)test.[jt]s?(x)` ], | ||
transform: { '^.+\\.[jt]sx?$': path.join( __dirname, 'bin', 'babel-transform' ) }, | ||
testEnvironment: 'jsdom', | ||
setupFilesAfterEnv: [ | ||
...( defaults.setupFilesAfterEnv || [] ), // extend if present | ||
'<rootDir>/apps/editing-toolkit/bin/js-unit-setup', | ||
], | ||
}; | ||
|
||
module.exports = config; |
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,5 @@ | ||
const createTransformer = require( 'babel-jest' ).default.createTransformer; | ||
|
||
module.exports = createTransformer( { | ||
presets: [ '@wordpress/babel-preset-default', '@babel/preset-typescript' ], | ||
} ); |
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,3 +1,32 @@ | ||
module.exports = { | ||
preset: '../../test/apps/jest-preset.js', | ||
/** | ||
* Test configuration for the Odyssey Stats. | ||
* | ||
* Will match files such that: | ||
* 1. Must be in the apps/odyssey-stats/ directory | ||
* 2. Must have .test.EXT at the end of the filename | ||
* 3. EXT (above) must be one of js, ts, jsx, or tsx. | ||
*/ | ||
|
||
const path = require( 'path' ); | ||
const base = require( '@automattic/calypso-jest' ); | ||
// @wordpress/scripts manually adds additional Jest config ontop of | ||
// @wordpress/jest-preset-default so we pull in this file to extend it | ||
const defaults = require( '@wordpress/scripts/config/jest-unit.config.js' ); | ||
|
||
// Basically, CWD, so 'apps/odyssey-stats'. | ||
// Without this, it tries to use 'apps/odyssey-stats/bin' | ||
const pluginRoot = path.resolve( './' ); | ||
|
||
const config = { | ||
...base, | ||
...defaults, | ||
rootDir: path.normalize( '../../' ), // To detect wp-calypso root node_modules | ||
testMatch: [ `${ pluginRoot }/**/?(*.)test.[jt]s?(x)` ], | ||
transform: { '^.+\\.[jt]sx?$': path.join( __dirname, 'bin', 'babel-transform' ) }, | ||
testEnvironment: 'jsdom', | ||
setupFilesAfterEnv: [ | ||
...( defaults.setupFilesAfterEnv || [] ), // extend if present | ||
], | ||
}; | ||
|
||
module.exports = config; |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.