-
Notifications
You must be signed in to change notification settings - Fork 0
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
Improve testing infrastructure #184
Merged
dchege711
merged 43 commits into
main
from
user/dchege711/testing/improve-testing-infra
Jun 24, 2024
Merged
Improve testing infrastructure #184
dchege711
merged 43 commits into
main
from
user/dchege711/testing/improve-testing-infra
Jun 24, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
That way, tests can exercise various code paths without interference.
Intended for use in testing client-side web components
Otherwise, `npm run test:client` errors out looking for the server's config.
added 186 packages, changed 1 package, and audited 1102 packages in 11s
added 9 packages, and audited 1111 packages in 4s
Needed for client-side testing that uses ES modules.
The logs are working as expected, erroring out in the TS file: ```log src/models/core/graph.test.ts: ❌ Test Graph > should have undirected edges AssertionError: expected 2 to equal 3 + expected - actual -2 +3 at n.<anonymous> (src/models/core/graph.test.ts:11:42) ``` This reverts commit 2021655.
Generated via: ```zsh $ git revert 0835a07 --no-commit $ npm install --save-dev @esm-bundle/chai ``` Previously, installing `chai@npm:@esm-bundle/chai` made the server-side tests also use the ES module version, which led to ts-mocha breaking: ```log TypeError: Unknown file extension ".ts" ```
…e/chai @open-wc/testing exposes chai as an ESM, and has useful plugins that are pre-configured: * @open-wc/semantic-dom-diff for dom tree / snapshot testing * @open-wc/chai-a11y-axe for a11y testing * chai-dom for dom testing No need to install @esm-bundle/chai separately. [1]: https://open-wc.org/docs/testing/testing-package/
`npm test src/components/search-bar/search-bar.test.ts` fails with: ```log src/components/search-bar/search-bar.test.ts: 🚧 Browser logs: Lit is in dev mode. Not recommended for production! See https://lit.dev/msg/dev-mode for more information. An error was thrown in a Promise outside a test. Did you forget to await a function or assertion? TRPCClientError: Unexpected token 'N', "Not Found" is not valid JSON at TRPCClientError.from (../../node_modules/@trpc/client/dist/TRPCClientError.mjs:37:16) at ../../node_modules/@trpc/client/dist/links/internals/httpUtils.mjs:110:36 🚧 404 network requests: - trpc/searchPublicCards?batch=1&input=%7B%220%22%3A%7B%22limit%22%3Anull%2C%22queryString%22%3A%22%22%7D%7D ❌ search-bar > should fetch initial results on load Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. at createTimeoutError (../../node_modules/@web/test-runner-mocha/dist/autorun.js:1:191473) at ds._timeoutError (../../node_modules/@web/test-runner-mocha/dist/autorun.js:1:195706) at ../../node_modules/@web/test-runner-mocha/dist/autorun.js:1:193787 ``` ... because the test is trying to fetch data from the server.
The requests still 404 out. Will revert shortly.
This reverts commit 0854cb0.
This reverts commit b913789.
Your Render PR Server URL is https://flashcards-pr-184.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cpscmbjqf0us73eek4a0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
supertest
to bring up an app instance and run E2E tests on it.web-test-runner
for client-side testing.Contributes to #183