Skip to content

Commit

Permalink
Add browser tests (#94)
Browse files Browse the repository at this point in the history
* Add browser tests
  • Loading branch information
mondeja authored May 11, 2022
1 parent 3ff4528 commit dfde704
Show file tree
Hide file tree
Showing 9 changed files with 6,428 additions and 958 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ jobs:
run: npm ci
- name: Build
run: npm run build
- name: Run examples
run: npm run examples
- name: Test
run: npm test
run: npm t
- name: Coverage
uses: coverallsapp/[email protected]
with:
Expand Down
14 changes: 14 additions & 0 deletions jest-puppeteer.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const path = require("path");

const PAGE_DIR = path.join("tests", "browser");
const PORT = 8080;

module.exports = {
launch: {
headless: process.env.TEST_HEADLESS !== "false",
},
server: {
command: `anywhere -s -p ${PORT} -d ${PAGE_DIR}`,
port: PORT,
},
};
3 changes: 2 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default {
preset: "ts-jest",
preset: "jest-puppeteer",
transform: { "^.+\\.ts?$": "ts-jest" },
collectCoverage: true,
coverageDirectory: "<rootDir>/tests/coverage",
collectCoverageFrom: ["src/*.ts"],
Expand Down
Loading

0 comments on commit dfde704

Please sign in to comment.