зеркало из https://github.com/golang/pkgsite.git
devtools/config: jest config updates
Adds a setup file for e2e testing with jest. This will let us consolidate setup code common to all e2e tests. Change-Id: I7f0ee7316b67e91345f7e47e507b5fd93da773c8 Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/292699 Trust: Jamal Carvalho <jamal@golang.org> Run-TryBot: Jamal Carvalho <jamal@golang.org> Reviewed-by: Jonathan Amsterdam <jba@google.com>
This commit is contained in:
Родитель
17f3512b1a
Коммит
656f5f670e
|
@ -0,0 +1,3 @@
|
|||
import { toMatchImageSnapshot } from 'jest-image-snapshot';
|
||||
|
||||
expect.extend({ toMatchImageSnapshot });
|
|
@ -1,5 +1,4 @@
|
|||
// eslint-disable-next-line no-undef
|
||||
module.exports = {
|
||||
let config = {
|
||||
preset: 'ts-jest',
|
||||
rootDir: '../../',
|
||||
globals: {
|
||||
|
@ -9,3 +8,16 @@ module.exports = {
|
|||
},
|
||||
moduleFileExtensions: ['ts', 'js'],
|
||||
};
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
const e2e = process.argv.includes('e2e');
|
||||
if (e2e) {
|
||||
config = {
|
||||
...config,
|
||||
setupFilesAfterEnv: ['<rootDir>/devtools/config/e2e-test-setup.ts'],
|
||||
testEnvironment: 'node',
|
||||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
module.exports = config;
|
||||
|
|
Загрузка…
Ссылка в новой задаче