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

Investigate switching to jest #430

Draft
wants to merge 60 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
c46d0d5
Investigate switching to jest
Sep 22, 2023
538246d
Add jest configuration
Sep 22, 2023
928f19b
Refactor controller Tests
Sep 22, 2023
f321343
unit test company model the jest way
Sep 26, 2023
23e221e
Fix Lint errors
Sep 28, 2023
373ab20
Add dev personal config files to gitignore
Cruikshanks Sep 28, 2023
9c228e6
Remove jest-fetch-mock package
Cruikshanks Sep 28, 2023
0401fb2
Stop standardjs complaining about Jest
Cruikshanks Sep 28, 2023
d92994a
Add some more Jest args for debugging
Cruikshanks Sep 28, 2023
3776322
Update Knex config to avoid hanging promises
Cruikshanks Sep 28, 2023
a3b223a
Add jest setup file
Cruikshanks Sep 28, 2023
1396b13
Update the jest config file
Cruikshanks Sep 28, 2023
1029bdf
Create a new test general helper file
Cruikshanks Sep 28, 2023
58611fb
Update all DB test helpers to be unique
Cruikshanks Sep 28, 2023
c18fb6f
Migrate all model tests to Jest
Cruikshanks Sep 28, 2023
fb2834a
Refactor bill-runs controller test
Sep 29, 2023
bbbd533
Remove erroneous console.log
Cruikshanks Sep 28, 2023
b16c702
Refactor billing-accounts controller test
Oct 1, 2023
6de8ae7
Completing refactoring controller tests
Oct 2, 2023
b79cf92
Refactor plugin tests
Oct 3, 2023
687f1d1
Refactor lib tests - First Part
Oct 4, 2023
6e3415f
completing lib tests - base-notifier|charging-module
Oct 5, 2023
931f99f
Merge branch 'main' into jest
Oct 6, 2023
470f7db
Merge branch 'main' into jest
Oct 7, 2023
58d7550
Investigate switching to jest
Sep 22, 2023
4093445
Add jest configuration
Sep 22, 2023
ac78030
Refactor controller Tests
Sep 22, 2023
2f0ec00
unit test company model the jest way
Sep 26, 2023
88e44c3
Fix Lint errors
Sep 28, 2023
846128b
Add dev personal config files to gitignore
Cruikshanks Sep 28, 2023
6d08be5
Remove jest-fetch-mock package
Cruikshanks Sep 28, 2023
2b88fc7
Stop standardjs complaining about Jest
Cruikshanks Sep 28, 2023
5a3bf28
Add some more Jest args for debugging
Cruikshanks Sep 28, 2023
3f027e3
Update Knex config to avoid hanging promises
Cruikshanks Sep 28, 2023
ff4bddb
Add jest setup file
Cruikshanks Sep 28, 2023
ce033d1
Update the jest config file
Cruikshanks Sep 28, 2023
f63194b
Update all DB test helpers to be unique
Cruikshanks Sep 28, 2023
bf1829a
Update all DB test helpers to be unique
Cruikshanks Oct 8, 2023
22a815d
Migrate all model tests to Jest
Cruikshanks Sep 28, 2023
2d83f2b
Refactor bill-runs controller test
Sep 29, 2023
6b2d5bd
Remove erroneous console.log
Cruikshanks Sep 28, 2023
a8a45be
Refactor billing-accounts controller test
Oct 1, 2023
5051020
Completing refactoring controller tests
Oct 2, 2023
3e725a6
Refactor plugin tests
Oct 3, 2023
9ee4c36
Refactor lib tests - First Part
Oct 4, 2023
9443184
completing lib tests - base-notifier|charging-module
Oct 5, 2023
c32cc96
Deal with linting issue
Cruikshanks Oct 8, 2023
ea6141f
continue with other libs
Oct 9, 2023
4dac78f
Resolved conflicts
Oct 9, 2023
0774f17
Refactor presenter tests
Oct 11, 2023
9acf27b
Merge branch 'main' into jest
Oct 11, 2023
3198a19
Update model tests
Oct 12, 2023
dc0193a
update services - plugins and charging-module-token
Oct 13, 2023
1f159b8
completings services/plugins
Oct 16, 2023
09127d5
Exclude charging-module-token-cache.plugin.test.js
Oct 16, 2023
05b9e66
Refactor charging-module-token-cache-plugin
Oct 17, 2023
7b001c9
Resolved conflicts
Oct 17, 2023
f3f69a8
Merge branch 'main' into jest
Oct 18, 2023
e060b47
Test billing/supplementary
Oct 19, 2023
facbb78
Merge branch 'main' into jest
Oct 19, 2023
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
# VSCode configuration
/.vscode

# Dev personal config
jsconfig.json
wallaby.js

# Logs, temp and OS specific files
/log/*
!/log/.keep
Expand Down
30 changes: 30 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict'

module.exports = {
collectCoverage: true,
collectCoverageFrom: [
'**/app/**/*.js',
'**/config/**/*.js',
'**/index.js'
],
coverageDirectory: './coverage',
coverageReporters: [
'lcov',
['text', { skipFull: true }]
],
globalSetup: './test/support/jest.setup.js',
testEnvironment: 'node',
// The glob patterns Jest uses to detect test files
testMatch: [
'**/test/controllers/*.test.js',
'**/test/errors/*.test.js',
'**/test/models/**/*.test.js',
'**/test/plugins/**/*.test.js',
'**/test/lib/**/base-notifier.lib.test.js',
'**/test/lib/**/boom-notifier.lib.test.js',
'**/test/lib/**/charging-module-request.lib.test.js',
'**/test/lib/**/general.lib.test.js'

],
verbose: true
}
1 change: 1 addition & 0 deletions knexfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const development = {

const test = {
...defaultConfig,
pool: { min: 0, idleTimeoutMillis: 500 },
connection: {
...defaultConnection,
database: DatabaseConfig.testDatabase
Expand Down
Loading
Loading