test: fix unit tests on windows machines (#3678)
This commit is contained in:
parent
3e5ff71846
commit
02f3cdd102
19
.github/workflows/nodejs.yml
vendored
19
.github/workflows/nodejs.yml
vendored
@ -39,18 +39,19 @@ jobs:
|
|||||||
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
- name: npm install, unit test and build
|
- name: log versions
|
||||||
run: |
|
run: node --version && npm --version && yarn --version
|
||||||
node --version
|
- name: install dependecies
|
||||||
npm --version
|
run: yarn --frozen-lockfile && yarn bootstrap
|
||||||
yarn --version
|
- name: run unit tests
|
||||||
yarn --frozen-lockfile
|
run: yarn test:ci
|
||||||
yarn bootstrap
|
|
||||||
yarn test:ci
|
|
||||||
yarn build:demo
|
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
NODE_OPTIONS: --max-old-space-size=4096
|
NODE_OPTIONS: --max-old-space-size=4096
|
||||||
|
- name: build demo site
|
||||||
|
run: yarn build:demo
|
||||||
|
env:
|
||||||
|
NODE_OPTIONS: --max-old-space-size=4096
|
||||||
- uses: actions/upload-artifact@master
|
- uses: actions/upload-artifact@master
|
||||||
with:
|
with:
|
||||||
name: dev-test-website-${{ runner.os }}-node-${{ matrix.node-version }}
|
name: dev-test-website-${{ runner.os }}-node-${{ matrix.node-version }}
|
||||||
|
@ -4,6 +4,13 @@ import fetch from 'node-fetch';
|
|||||||
import * as emotion from 'emotion';
|
import * as emotion from 'emotion';
|
||||||
import { createSerializer } from 'jest-emotion';
|
import { createSerializer } from 'jest-emotion';
|
||||||
|
|
||||||
|
jest.mock('path', () => {
|
||||||
|
const actual = jest.requireActual('path');
|
||||||
|
return {
|
||||||
|
...actual.posix,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
window.fetch = fetch;
|
window.fetch = fetch;
|
||||||
window.URL.createObjectURL = jest.fn();
|
window.URL.createObjectURL = jest.fn();
|
||||||
expect.addSnapshotSerializer(createSerializer(emotion));
|
expect.addSnapshotSerializer(createSerializer(emotion));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user