Skip to content

Commit 2ede42d

Browse files
Add testing in browsers (#21)
* Switch testing to tape This is primarily to support a future addition of airtap which relies on tape. * Run tests in a browser * Run browser tests in CI * Add test coverage
1 parent d124635 commit 2ede42d

File tree

6 files changed

+25
-7
lines changed

6 files changed

+25
-7
lines changed

.airtap.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
providers:
2+
- airtap-playwright
3+
4+
browsers:
5+
- name: chromium
6+
supports:
7+
headless: true

.dependabot/config.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@ update_configs:
33
- package_manager: "javascript"
44
directory: "/"
55
update_schedule: "daily"
6-
ignored_updates:
7-
- match:
8-
dependency_name: "tap"

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
name: CI workflow
22
on: [push, pull_request]
33
jobs:
4+
browsers:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-node@v1
9+
- name: Install Dependencies
10+
run: npm install
11+
- name: Test
12+
run: npm run test-in-browsers
413
test:
514
runs-on: ubuntu-latest
615
strategy:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
**/node_modules
22
**/package-lock.json
33

4-
coverage.*
4+
/.nyc_output
55

66
**/.DS_Store
77
**/._*

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "index.js",
66
"scripts": {
77
"benchmark": "cd benchmarks && npm install && npm run all",
8-
"test": "standard && tap test.js"
8+
"test": "standard && nyc tape test.js",
9+
"test-in-browsers": "airtap test.js"
910
},
1011
"repository": {
1112
"type": "git",
@@ -25,7 +26,11 @@
2526
},
2627
"homepage": "https://github.com/fastify/secure-json-parse#readme",
2728
"devDependencies": {
29+
"airtap": "^4.0.1",
30+
"airtap-playwright": "^1.0.1",
31+
"nyc": "^14.1.1",
32+
"playwright": "^1.7.1",
2833
"standard": "^16.0.0",
29-
"tap": "^12.7.0"
34+
"tape": "^5.1.1"
3035
}
3136
}

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
const test = require('tap').test
3+
const test = require('tape').test
44
const j = require('./index')
55

66
test('parse', t => {

0 commit comments

Comments
 (0)