Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(client): initial Jest + RTL setup #1992

Merged
merged 22 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2a68920
test(client): initial Jest + RTL setup
ubbe-xyz May 13, 2021
c7629b1
test(client): add tests for `getSession`
ubbe-xyz May 14, 2021
a3e9fa1
test(client): document expect cases and fix regex
ubbe-xyz May 20, 2021
d54d505
test(client): small refactors
ubbe-xyz May 20, 2021
8d277c6
chore(npm): re-generate package-lock.json
ubbe-xyz May 20, 2021
ba2fbb9
Merge branch 'main' into test/client-module
ubbe-xyz May 20, 2021
baab326
test(client): initial test for `signIn`
ubbe-xyz May 20, 2021
96034e9
test(client): refactor session tests for consistency
ubbe-xyz May 20, 2021
2654e24
test(client): credentials/email signin scenarios
ubbe-xyz May 25, 2021
6097604
test(client): finish sign-in tests
ubbe-xyz May 27, 2021
e6da932
chore(github): add test to ci
ubbe-xyz May 27, 2021
5ceae67
Merge 'origin/main' into 'test/client-module'
ubbe-xyz May 27, 2021
1b173a2
Merge branch 'main' into test/client-module
ubbe-xyz May 28, 2021
fc0f7af
Merge branch 'main' into test/client-module
ubbe-xyz May 28, 2021
c345402
Merge branch 'main' into test/client-module
ubbe-xyz May 30, 2021
97b4cd0
test(client): refactor and extend use cases
ubbe-xyz May 30, 2021
59dc395
test(client): sign-out tests
ubbe-xyz May 30, 2021
2a9978a
refactor(client): code review suggestions (1)
ubbe-xyz May 30, 2021
4f38465
test(client): add few more sign-in/sign-out cases
ubbe-xyz Jun 1, 2021
f5f70c1
test(client): broadcasting session events
ubbe-xyz Jun 1, 2021
c81355e
Merge branch 'main' into test/client-module
ubbe-xyz Jun 1, 2021
cf0d203
fix(client): handle fetch providers error
ubbe-xyz Jun 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Tests

on:
push:
branches:
- main
- beta
- next
pull_request:
branches:
- main
- beta
- next

jobs:
types:
name: "Types"
runs-on: ubuntu-latest
steps:
- name: Init
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Check types
run: npm run test:types
tests:
name: "Integration Tests"
runs-on: ubuntu-latest
steps:
- name: Init
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- name: Install dependencies
uses: bahmutov/npm-install@v1
- name: Run tests
run: npm test -- --ci
27 changes: 0 additions & 27 deletions .github/workflows/types.yml

This file was deleted.

11 changes: 11 additions & 0 deletions config/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,16 @@ module.exports = {
test: ["../src/server/pages/**"],
presets: ["preact"],
},
{
test: ["../src/**/*.test.js"],
presets: [
[
"@babel/preset-react",
{
runtime: "automatic",
},
],
],
},
],
}
2 changes: 2 additions & 0 deletions config/jest-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import "@testing-library/jest-dom"
import "whatwg-fetch"
8 changes: 8 additions & 0 deletions config/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
transform: {
"\\.js$": ["babel-jest", { configFile: "./config/babel.config.js" }],
},
roots: ["../src"],
setupFilesAfterEnv: ["./jest-setup.js"],
testMatch: ["**/*.test.js"],
}
Loading