From 26bf656b18fa333d6616a5d882e4221d61c36ac6 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 00:21:09 +0000 Subject: [PATCH 01/18] chore: actions --- .github/main.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/main.yml diff --git a/.github/main.yml b/.github/main.yml new file mode 100644 index 00000000..9a55ca84 --- /dev/null +++ b/.github/main.yml @@ -0,0 +1,31 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Test +env: + CI: true +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + name: Node ${{ matrix.node_version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + node_version: ['12.x'] + os: [ubuntu-latest] + #node_version: ['10.x', '12.x', '13.'] + #os: [ubuntu-latest, windows-latest, macOS-latest] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: yarn + - run: yarn lint + - run: ./cli.js mocks/test.mocha.js From fbd83b02e5b74249069f29964bac1f671b59e775 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 00:23:36 +0000 Subject: [PATCH 02/18] chore: actions --- .github/main.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/main.yml diff --git a/.github/main.yml b/.github/main.yml deleted file mode 100644 index 9a55ca84..00000000 --- a/.github/main.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: Test -env: - CI: true -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - test: - name: Node ${{ matrix.node_version }} and ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - node_version: ['12.x'] - os: [ubuntu-latest] - #node_version: ['10.x', '12.x', '13.'] - #os: [ubuntu-latest, windows-latest, macOS-latest] - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: yarn - - run: yarn lint - - run: ./cli.js mocks/test.mocha.js From a591800f71536b6b464c1c755a3fba1a9f1bd49a Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 00:24:42 +0000 Subject: [PATCH 03/18] chore: actions --- .github/workflows/main.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..9a55ca84 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,31 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Test +env: + CI: true +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + name: Node ${{ matrix.node_version }} and ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + node_version: ['12.x'] + os: [ubuntu-latest] + #node_version: ['10.x', '12.x', '13.'] + #os: [ubuntu-latest, windows-latest, macOS-latest] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: yarn + - run: yarn lint + - run: ./cli.js mocks/test.mocha.js From 2f18960054410caf9cc5fbe2369433ae795f4d4f Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 00:28:46 +0000 Subject: [PATCH 04/18] chore: actions --- src/utils.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils.js b/src/utils.js index 8037a1c9..e0272f4c 100644 --- a/src/utils.js +++ b/src/utils.js @@ -165,6 +165,7 @@ async function downloadBrowser(browserInstance, spinner) { spinner.text = `Downloading ${browser} ${browserType._revision}`; await fetcher.download(revisionInfo.revision, onProgress); spinner.text = `Browser ${browser} cached to ${revisionInfo.folderPath}`; + console.log(`Browser ${browser} cached to ${revisionInfo.folderPath}`); return revisionInfo; } From 7ea67dbdd33d509461eaf185f9f1c44ba14d7d77 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 00:33:30 +0000 Subject: [PATCH 05/18] chore: actions --- src/runner.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runner.js b/src/runner.js index bc8bd65c..4763c73a 100644 --- a/src/runner.js +++ b/src/runner.js @@ -83,7 +83,8 @@ class Runner { args: this.options.extension ? [ `--disable-extensions-except=${this.dir}`, `--load-extension=${this.dir}` - ] : [] + ] : [], + dumpio: true }; // extension only works in incognito for now From 9bb697aaff73d353e43cd078994c16527b9a8f41 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 00:43:20 +0000 Subject: [PATCH 06/18] chore: actions --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a55ca84..f99b117e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,4 +28,5 @@ jobs: node-version: ${{ matrix.node-version }} - run: yarn - run: yarn lint + - run: sudo apt install libgbm - run: ./cli.js mocks/test.mocha.js From 3dcd4f6a841c9627e7697759b3de8b7ffda4ad0a Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 00:44:29 +0000 Subject: [PATCH 07/18] chore: actions --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f99b117e..f95bc890 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,5 +28,5 @@ jobs: node-version: ${{ matrix.node-version }} - run: yarn - run: yarn lint - - run: sudo apt install libgbm + - run: sudo apt-get install libgbm - run: ./cli.js mocks/test.mocha.js From 194910308de77cc1431a92a93f9de10525dd01d2 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 00:48:40 +0000 Subject: [PATCH 08/18] chore: actions --- .github/workflows/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f95bc890..7fd6fea0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,7 @@ name: Test env: CI: true + FORCE_COLOR: 1 on: push: branches: [ master ] @@ -26,7 +27,10 @@ jobs: uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} + - name: install required packages + run: | + sudo apt-get update + sudo apt-get install libgbm-dev - run: yarn - run: yarn lint - - run: sudo apt-get install libgbm - run: ./cli.js mocks/test.mocha.js From eff38411b201fa75172a9e4bd9ca3df7408203c0 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 00:53:19 +0000 Subject: [PATCH 09/18] chore: actions --- mocks/test.mocha.js | 3 +-- src/runner.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mocks/test.mocha.js b/mocks/test.mocha.js index 864e4611..e83747c0 100644 --- a/mocks/test.mocha.js +++ b/mocks/test.mocha.js @@ -10,8 +10,7 @@ describe('Array', () => { it('should fail ', () => { // console.log(chrome); - // localStorage.setItem('myCat', 'Tom'); - assert.equal([1, 2, 3].indexOf(2), -1); + assert.equal([1, 2, 3].indexOf(2), 1); }); }); }); diff --git a/src/runner.js b/src/runner.js index 4763c73a..785557b3 100644 --- a/src/runner.js +++ b/src/runner.js @@ -84,7 +84,7 @@ class Runner { `--disable-extensions-except=${this.dir}`, `--load-extension=${this.dir}` ] : [], - dumpio: true + dumpio: process.env.PW_TEST_DUMPIO || false }; // extension only works in incognito for now From a43d060c7e82aaab44cebc2e65f9dd03746aa9a2 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 01:06:12 +0000 Subject: [PATCH 10/18] chore: actions --- .editorconfig | 2 +- .github/workflows/main.yml | 75 ++++++++++++++++++++++++++++++++------ src/utils.js | 1 - 3 files changed, 64 insertions(+), 14 deletions(-) diff --git a/.editorconfig b/.editorconfig index 6b19c50d..f605ae41 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,7 +8,7 @@ charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true -[{*.yml}] +[*.yml] indent_style = space indent_size = 2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7fd6fea0..1bac6e5c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ # This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions -name: Test +name: tests env: CI: true FORCE_COLOR: 1 @@ -12,25 +12,76 @@ on: branches: [ master ] jobs: - test: - name: Node ${{ matrix.node_version }} and ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - node_version: ['12.x'] - os: [ubuntu-latest] - #node_version: ['10.x', '12.x', '13.'] - #os: [ubuntu-latest, windows-latest, macOS-latest] + chromium_linux: + name: "Chromium Linux" + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: - node-version: ${{ matrix.node-version }} + node-version: '12.x' - name: install required packages run: | sudo apt-get update sudo apt-get install libgbm-dev - run: yarn - - run: yarn lint + - run: ./cli.js mocks/test.mocha.js + + chromium_macos: + name: "Chromium Mac" + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: '12.x' + - run: yarn + - run: ./cli.js mocks/test.mocha.js + + chromium_win: + name: "Chromium Win" + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: '12.x' + - run: yarn + - run: ./cli.js mocks/test.mocha.js + shell: bash + + webkit_linux: + name: "WebKit Linux" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: '12.x' + - name: install required packages + run: | + sudo apt-get update + sudo apt-get install libwoff1 libopus0 libwebp6 libwebpdemux2 libenchant1c2a libgudev-1.0-0 libsecret-1-0 libhyphen0 libgdk-pixbuf2.0-0 libegl1 libgles2 libevent-2.1-6 libnotify4 libxslt1.1 + sudo apt-get install xvfb + - run: yarn + - run: ./cli.js mocks/test.mocha.js + + firefox_linux: + name: "Firefox Linux" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: '12.x' + - name: install required packages + run: | + sudo apt-get update + sudo apt-get install xvfb + - run: yarn - run: ./cli.js mocks/test.mocha.js diff --git a/src/utils.js b/src/utils.js index e0272f4c..8037a1c9 100644 --- a/src/utils.js +++ b/src/utils.js @@ -165,7 +165,6 @@ async function downloadBrowser(browserInstance, spinner) { spinner.text = `Downloading ${browser} ${browserType._revision}`; await fetcher.download(revisionInfo.revision, onProgress); spinner.text = `Browser ${browser} cached to ${revisionInfo.folderPath}`; - console.log(`Browser ${browser} cached to ${revisionInfo.folderPath}`); return revisionInfo; } From 0394e0cc49cfb9d70526791c10ce9fba06caa503 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 01:08:48 +0000 Subject: [PATCH 11/18] chore: actions --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1bac6e5c..3be3a758 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,3 +85,5 @@ jobs: sudo apt-get install xvfb - run: yarn - run: ./cli.js mocks/test.mocha.js + env: + PW_TEST_DUMPIO: true From fc2996366f9b1c9f568bc914fc189f8bf504eab2 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 01:10:41 +0000 Subject: [PATCH 12/18] chore: actions --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3be3a758..2f83700c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,7 +68,7 @@ jobs: sudo apt-get install libwoff1 libopus0 libwebp6 libwebpdemux2 libenchant1c2a libgudev-1.0-0 libsecret-1-0 libhyphen0 libgdk-pixbuf2.0-0 libegl1 libgles2 libevent-2.1-6 libnotify4 libxslt1.1 sudo apt-get install xvfb - run: yarn - - run: ./cli.js mocks/test.mocha.js + - run: ./cli.js mocks/test.mocha.js --browser webkit firefox_linux: name: "Firefox Linux" @@ -84,6 +84,6 @@ jobs: sudo apt-get update sudo apt-get install xvfb - run: yarn - - run: ./cli.js mocks/test.mocha.js + - run: ./cli.js mocks/test.mocha.js --browser firefox env: PW_TEST_DUMPIO: true From ad8f5e835b3308380aa736f56c3a35cc2dfe8ef7 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 01:13:50 +0000 Subject: [PATCH 13/18] chore: actions --- .github/workflows/main.yml | 2 -- src/utils.js | 4 ++++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2f83700c..80df28fa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -85,5 +85,3 @@ jobs: sudo apt-get install xvfb - run: yarn - run: ./cli.js mocks/test.mocha.js --browser firefox - env: - PW_TEST_DUMPIO: true diff --git a/src/utils.js b/src/utils.js index 8037a1c9..64274c28 100644 --- a/src/utils.js +++ b/src/utils.js @@ -183,6 +183,10 @@ const getPw = async (browserName, cachePath, spinner) => { } } + if (process.env.CI) { + cachePath = path.join(__dirname, '../.cache'); + } + if (!fs.existsSync(cachePath)) { await fs.promises.mkdir(cachePath); } From 459fce68c8c274217b830bb765dc36dbaa4a9ce6 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 01:25:08 +0000 Subject: [PATCH 14/18] chore: actions --- .github/workflows/main.yml | 27 ++++++++++++++------------- readme.md | 2 +- src/utils.js | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 80df28fa..ad8815ab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,24 +17,28 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + - uses: actions/setup-node@v1 with: node-version: '12.x' - - name: install required packages + - name: Install required packages run: | sudo apt-get update sudo apt-get install libgbm-dev + sudo apt-get install xvfb - run: yarn - run: ./cli.js mocks/test.mocha.js + - run: ./cli.js mocks/test.mocha.js --incognito + - run: ./cli.js mocks/test.mocha.js --mode worker + - run: xvfb-run -a ./cli.js mocks/test.mocha.js --extention + - run: ./cli.js mocks/test.tape.js --runner tape + - run: ./cli.js mocks/benchmark.js --runner benchmark chromium_macos: name: "Chromium Mac" runs-on: macos-latest steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + - uses: actions/setup-node@v1 with: node-version: '12.x' - run: yarn @@ -45,8 +49,7 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + - uses: actions/setup-node@v1 with: node-version: '12.x' - run: yarn @@ -58,11 +61,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + - uses: actions/setup-node@v1 with: node-version: '12.x' - - name: install required packages + - name: Install required packages run: | sudo apt-get update sudo apt-get install libwoff1 libopus0 libwebp6 libwebpdemux2 libenchant1c2a libgudev-1.0-0 libsecret-1-0 libhyphen0 libgdk-pixbuf2.0-0 libegl1 libgles2 libevent-2.1-6 libnotify4 libxslt1.1 @@ -75,11 +77,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + - uses: actions/setup-node@v1 with: node-version: '12.x' - - name: install required packages + - name: Install required packages run: | sudo apt-get update sudo apt-get install xvfb diff --git a/readme.md b/readme.md index 64b8312b..bb051e7a 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# playwright-test [![NPM Version](https://img.shields.io/npm/v/playwright-test.svg)](https://www.npmjs.com/package/playwright-test) [![NPM Downloads](https://img.shields.io/npm/dt/playwright-test.svg)](https://www.npmjs.com/package/playwright-test) [![NPM License](https://img.shields.io/npm/l/playwright-test.svg)](https://www.npmjs.com/package/playwright-test) [![Build Status](https://travis-ci.org/hugomrdias/playwright-test.svg?branch=master)](https://travis-ci.org/hugomrdias/playwright-test) +# playwright-test [![NPM Version](https://img.shields.io/npm/v/playwright-test.svg)](https://www.npmjs.com/package/playwright-test) [![NPM Downloads](https://img.shields.io/npm/dt/playwright-test.svg)](https://www.npmjs.com/package/playwright-test) [![NPM License](https://img.shields.io/npm/l/playwright-test.svg)](https://www.npmjs.com/package/playwright-test) ![tests](https://github.com/hugomrdias/playwright-test/workflows/tests/badge.svg) > Run mocha, tape and benchmark.js scripts inside real browsers with `playwright`. diff --git a/src/utils.js b/src/utils.js index 64274c28..10fa9766 100644 --- a/src/utils.js +++ b/src/utils.js @@ -184,7 +184,7 @@ const getPw = async (browserName, cachePath, spinner) => { } if (process.env.CI) { - cachePath = path.join(__dirname, '../.cache'); + cachePath = path.join(process.cwd(), '.cache'); } if (!fs.existsSync(cachePath)) { From 45aefa5d7c94304772a27746a74f5c04dbcc0aa1 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 01:35:05 +0000 Subject: [PATCH 15/18] chore: actions --- src/runner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runner.js b/src/runner.js index 785557b3..3184664b 100644 --- a/src/runner.js +++ b/src/runner.js @@ -100,7 +100,7 @@ class Runner { async setupPage() { if (this.options.extension) { - const targets = await this.context.targets(); + const targets = await this.browser.targets(); const backgroundPageTarget = targets.find(target => target.type() === 'background_page'); this.page = await backgroundPageTarget.page(); From 4ebcdf0eac8492a78e4b86373542cc41fc1384a7 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 01:37:03 +0000 Subject: [PATCH 16/18] chore: actions --- .github/workflows/main.yml | 2 +- .travis.yml | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ad8815ab..f395fc8f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,7 @@ jobs: - run: ./cli.js mocks/test.mocha.js - run: ./cli.js mocks/test.mocha.js --incognito - run: ./cli.js mocks/test.mocha.js --mode worker - - run: xvfb-run -a ./cli.js mocks/test.mocha.js --extention + - run: xvfb-run -a ./cli.js mocks/test.mocha.js --extension - run: ./cli.js mocks/test.tape.js --runner tape - run: ./cli.js mocks/benchmark.js --runner benchmark diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5e6eb855..00000000 --- a/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: - - '10' - - '12' -after_script: - - 'yarn cov:report' - -notifications: - email: false From 770cba9b01cc4aca3815b4e23f8d4189a2bc2b20 Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 01:39:22 +0000 Subject: [PATCH 17/18] chore: actions --- mocks/test.tape.js | 5 ----- mocks/test2.tape.js | 5 ----- 2 files changed, 10 deletions(-) diff --git a/mocks/test.tape.js b/mocks/test.tape.js index 5dff440d..708d8cf2 100644 --- a/mocks/test.tape.js +++ b/mocks/test.tape.js @@ -9,11 +9,6 @@ test('timing test', (t) => { t.plan(2); t.equal(typeof Date.now, 'function'); - const start = Date.now(); - - setTimeout(() => { - t.equal(Date.now() - start, 100); - }, 100); }); test('controller exists', (t) => { diff --git a/mocks/test2.tape.js b/mocks/test2.tape.js index 4d0c8f0f..75f0dd03 100644 --- a/mocks/test2.tape.js +++ b/mocks/test2.tape.js @@ -6,9 +6,4 @@ test('timing test 2', (t) => { t.plan(2); t.equal(typeof Date.now, 'function'); - const start = Date.now(); - - setTimeout(() => { - t.equal(Date.now() - start, 100); - }, 100); }); From 78ad8f5d5f85a6e6ae55cc42a0f380ff730ac3fe Mon Sep 17 00:00:00 2001 From: Hugo Dias Date: Sun, 8 Mar 2020 01:49:56 +0000 Subject: [PATCH 18/18] chore: actions --- mocks/test.tape.js | 7 +++---- mocks/test2.tape.js | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mocks/test.tape.js b/mocks/test.tape.js index 708d8cf2..e841157a 100644 --- a/mocks/test.tape.js +++ b/mocks/test.tape.js @@ -6,14 +6,13 @@ const debug = require('debug'); const error = debug('app:error'); test('timing test', (t) => { - t.plan(2); - t.equal(typeof Date.now, 'function'); + t.end(); }); test('controller exists', (t) => { - t.plan(1); error('testing debug'); - t.ok(self.pwTestController); + t.equal(typeof Date.now, 'function'); + t.end(); }); diff --git a/mocks/test2.tape.js b/mocks/test2.tape.js index 75f0dd03..efa3e9f7 100644 --- a/mocks/test2.tape.js +++ b/mocks/test2.tape.js @@ -3,7 +3,7 @@ const test = require('tape'); test('timing test 2', (t) => { - t.plan(2); + t.plan(1); t.equal(typeof Date.now, 'function'); });