Skip to content

Commit 08ddb7b

Browse files
axe312germgoudy91
andauthored
Refactor: replace test suite with vitest (#2328)
* 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 <mgoudy91@gmail.com> * 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 <mgoudy91@gmail.com>
1 parent da65d62 commit 08ddb7b

File tree

194 files changed

+15394
-15904
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+15394
-15904
lines changed

.babelrc.js

-7
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,4 @@ if (env === 'node') {
6767
})
6868
}
6969

70-
if (env === 'test') {
71-
babelConfig = Object.assign(babelConfig, {
72-
presets: [['@babel/preset-env', testBabelPresetEnvConfig], '@babel/typescript'],
73-
plugins: babelConfig.plugins.concat(['rewire-ts']),
74-
})
75-
}
76-
7770
module.exports = babelConfig

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ lib-cov
5050
# Coverage directory used by tools like istanbul
5151
coverage
5252

53-
# nyc test coverage
54-
.nyc_output
55-
5653
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
5754
.grunt
5855

karma.base.conf.js

-63
This file was deleted.

karma.conf.local.js

-9
This file was deleted.

lib/plain/plain-client-test.ts

-219
This file was deleted.

mocharc.js

-12
This file was deleted.

0 commit comments

Comments
 (0)