From c9b1cd18a82a429a386f0a42085f4a654bcc0079 Mon Sep 17 00:00:00 2001 From: Will Griffiths Date: Mon, 26 Aug 2019 22:13:00 +1000 Subject: [PATCH 1/4] Add e2e test for jest --- .github/workflows/e2e-jest-workflow.yml | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/e2e-jest-workflow.yml diff --git a/.github/workflows/e2e-jest-workflow.yml b/.github/workflows/e2e-jest-workflow.yml new file mode 100644 index 000000000000..20cce9675651 --- /dev/null +++ b/.github/workflows/e2e-jest-workflow.yml @@ -0,0 +1,41 @@ +on: + schedule: + - cron: '0 */4 * * *' + push: + branches: + - master + pull_request: + paths: + - .github/workflows/e2e-jest-workflow.yml + - scripts/e2e-setup-ci.sh + +name: 'E2E Jest' +jobs: + chore: + name: 'Validating Jest' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@master + + - name: 'Use Node.js 10.x' + uses: actions/setup-node@master + with: + version: 10.x + + - name: 'Build the standard bundle' + run: | + node ./scripts/run-yarn.js build:cli + + - name: 'Running the integration test' + run: | + source scripts/e2e-setup-ci.sh + + yarn init -p + yarn add jest + + echo "it('should pass', () => { \n expect(true).toBeTruthy(); });" > pass.test.js + yarn jest pass.test.js + + echo "it('should fail', () => { \n expect(false).toBeTruthy(); });" > fail.test.js + ! yarn jest fail.test.js From 912d64dbf8c860c7a02cff3365110877624bae0a Mon Sep 17 00:00:00 2001 From: Will Griffiths Date: Mon, 26 Aug 2019 22:18:00 +1000 Subject: [PATCH 2/4] Fix typo --- .github/workflows/e2e-jest-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e-jest-workflow.yml b/.github/workflows/e2e-jest-workflow.yml index 20cce9675651..4557b4ece9d6 100644 --- a/.github/workflows/e2e-jest-workflow.yml +++ b/.github/workflows/e2e-jest-workflow.yml @@ -34,8 +34,8 @@ jobs: yarn init -p yarn add jest - echo "it('should pass', () => { \n expect(true).toBeTruthy(); });" > pass.test.js + echo "it('should pass', () => { expect(true).toBeTruthy(); });" > pass.test.js yarn jest pass.test.js - echo "it('should fail', () => { \n expect(false).toBeTruthy(); });" > fail.test.js + echo "it('should fail', () => { expect(false).toBeTruthy(); });" > fail.test.js ! yarn jest fail.test.js From bfc94d24ed69b7ab22a92e99c638c14d173a6020 Mon Sep 17 00:00:00 2001 From: Will Griffiths Date: Mon, 26 Aug 2019 22:32:48 +1000 Subject: [PATCH 3/4] Add test case for module resolution --- .github/workflows/e2e-jest-workflow.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/e2e-jest-workflow.yml b/.github/workflows/e2e-jest-workflow.yml index 4557b4ece9d6..12bfb9dd0d22 100644 --- a/.github/workflows/e2e-jest-workflow.yml +++ b/.github/workflows/e2e-jest-workflow.yml @@ -39,3 +39,8 @@ jobs: echo "it('should fail', () => { expect(false).toBeTruthy(); });" > fail.test.js ! yarn jest fail.test.js + + yarn add left-pad + + echo "const leftPad = require("left-pad"); it('should resolve a module', () => { expect(typeof leftPad).toBe("function");});" > module.test.js + yarn jest module.test.js From 7beffcc9e1f624dca90358aca8a1b729b1ffa30c Mon Sep 17 00:00:00 2001 From: Will Griffiths Date: Mon, 26 Aug 2019 22:37:27 +1000 Subject: [PATCH 4/4] Fix string formatting for bash --- .github/workflows/e2e-jest-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-jest-workflow.yml b/.github/workflows/e2e-jest-workflow.yml index 12bfb9dd0d22..4ca88b03cccb 100644 --- a/.github/workflows/e2e-jest-workflow.yml +++ b/.github/workflows/e2e-jest-workflow.yml @@ -42,5 +42,5 @@ jobs: yarn add left-pad - echo "const leftPad = require("left-pad"); it('should resolve a module', () => { expect(typeof leftPad).toBe("function");});" > module.test.js + echo "const leftPad = require('left-pad'); it('should resolve a module', () => { expect(typeof leftPad).toBe('function');});" > module.test.js yarn jest module.test.js