-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from soundcut/add-test-framework
Add test framework
- Loading branch information
Showing
10 changed files
with
5,630 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Install > Build > Test | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Using Node.js 12 | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- name: Install | ||
run: npm ci | ||
- name: Build | ||
run: npm run build:production | ||
- name: Install Test Dependencies | ||
run: cd test; npm ci; | ||
- name: Test | ||
run: npm test |
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,2 +1,3 @@ | ||
node_modules/* | ||
**/node_modules/* | ||
.vscode/ |
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 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,29 @@ | ||
const http = require('http'); | ||
const { Server } = require('node-static'); | ||
require('expect-puppeteer'); | ||
|
||
const port = 3002; | ||
const url = `http://localhost:${port}/test/`; | ||
|
||
let server; | ||
|
||
describe('decode-audio-data-fast tests in headless browser', () => { | ||
let onPageError; | ||
beforeAll(async () => { | ||
const staticServer = new Server('..'); | ||
server = http | ||
.createServer((req, res) => staticServer.serve(req, res)) | ||
.listen(port); | ||
|
||
onPageError = jest.fn(); | ||
page.on('pageerror', onPageError); | ||
await page.goto(url); | ||
await page.waitFor(4000); | ||
}); | ||
|
||
it('should no throw any error', async () => { | ||
await expect(onPageError).not.toBeCalled(); | ||
}); | ||
|
||
afterAll(() => server.close()); | ||
}); |
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,3 @@ | ||
module.exports = { | ||
preset: 'jest-puppeteer', | ||
}; |
Oops, something went wrong.