Skip to content

Commit

Permalink
Refactor: replace test suite with vitest (#2328)
Browse files Browse the repository at this point in the history
* test: first introduction of vitest

* test: update create update test

* test: update entities to use vitest

* test: WIP - first entity type test refactor - content-types

* test: finally get content types tests rewritten, including all instance-entity-methods

* chore: delete old js file

* fix: fix mocks and type them

* test: refactor test/unit/entities to typescript and vitest

* refactor: port 4 more tests to TS + vitest

* refactor: port makeRequest helper to vitest

* test: refactor create ogranization api test

* test: refactor environment api to vitest

* test: refactor plain iterator tests

* test: small fixes

* test: migrate webhook test and prepare for plain client tests

* test: migrate rest adapter test

* test: migrate raw http request test

* test: migrate app-action-call tests

* test: rewrite entity mocks to be fully typed, complete and consistent in id mocking

* test: rewrite rest adapter tests - some still failing - sorry

* test: adjust other test files for new mocked ids

* build: make vitest/rollup run again

* style: add type to imports when only types are imported

* build: try to have less changes in the lock file

* test: add passing app definition api test - what a hell of a ride for one file

* test: rewrite create-space-api test

* test: rewrite create-ui-config-api-test and create-user-ui-config-api-test

* test: rewrite test/unit/plain tests to vitest (most not working yet)

* test: rewrite last files in unit tests to new vitest syntax

* test(integration): first integration test passing with vitest

* test(integration): rewrite all app related integration tests to vitest

* test(integration): rewrite more integration tests

* test(integration): move and rewrite plain client integration test

* test(integration): rewrite more test files to vitest

* test(integration): make ts more happy

* test(integration): remove custom timeouts as we will inforce them globally soon

* test(integration): rewrite environment test

* test(integration): cleanups + rewrite 3 more tests

* test(integration): rewrite resource related tests

* test(integration): role and scheduled action

* test(integration): rewrite last integration tests

* test(unit): refactor some new tests that got merged into the branch

* tests: remove last leftovers of chai and sinon in test code

* chore: remove sinon, mocha, chai, rewire and karma

* test: use vitest workspaces feature to run tests in browser as well and clean up/simplify calling of different test environments

* chore: remove excessive e2e file

* test: integration tests can now be executed in the browser

* test: TEMPORARILY let integration tests run right away

* test: make node and browser tests both execute happily next to each other

* test: fix mocking of rest adapter in unit tests

* test(unit): speed up app call tests that re-poll full 15 times

* test: make most unit tests pass

* test(unit): make all unit tests pass

* test: make browser and integration tests execute

* test: make webhook plain client test run in browser by replacing crypto package to mock payload data

* test: integration tests now pass, and dont get stuck in rate limiting as it seems. hurray

* test: adjust bundle max sizes to new bigger bundles

* test(unit): fix locale collection wrapping test

* test(integration): rate limiting timeout is now a fixed second as this is enough - slightly improving integration test runtime

* chore: remove old comments

* test: use vitest for coverage report

* build: npm dedupe

* build: ensure vitest is latest version

* Update test/helpers.ts

Co-authored-by: Mitch Goudy <[email protected]>

* Update config.yml

re-require unit tests to pass before we run the integration tests

* test(unit): adjust new tests from merge to pass

---------

Co-authored-by: Mitch Goudy <[email protected]>
  • Loading branch information
axe312ger and mgoudy91 authored Nov 21, 2024
1 parent da65d62 commit 08ddb7b
Show file tree
Hide file tree
Showing 194 changed files with 15,394 additions and 15,904 deletions.
7 changes: 0 additions & 7 deletions .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,4 @@ if (env === 'node') {
})
}

if (env === 'test') {
babelConfig = Object.assign(babelConfig, {
presets: [['@babel/preset-env', testBabelPresetEnvConfig], '@babel/typescript'],
plugins: babelConfig.plugins.concat(['rewire-ts']),
})
}

module.exports = babelConfig
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

Expand Down
63 changes: 0 additions & 63 deletions karma.base.conf.js

This file was deleted.

9 changes: 0 additions & 9 deletions karma.conf.local.js

This file was deleted.

219 changes: 0 additions & 219 deletions lib/plain/plain-client-test.ts

This file was deleted.

12 changes: 0 additions & 12 deletions mocharc.js

This file was deleted.

Loading

0 comments on commit 08ddb7b

Please sign in to comment.