Consider adding "testing/expect.ts" module
See original GitHub issueJest is arguably the most popular testing framework for Node ecosystem at the moment. It uses expect
style assertions, which seems to be very popular way of exercising tests too.
I was prompted to consider it by a recent issue in vitest
(which seems to be somewhat compatible with Jest.
To be clear: I prefer to write tests using testing/asserts.ts
, but we shouldn’t limit ourselves to only a single style, if the other is also very popular (> 8mm weekly downloads) then we should consider adding it too.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:30 (30 by maintainers)
Top Results From Across the Web
unit testing - TypeScript UnitTests on Module - Stack Overflow
Have app.ts : export class Config { testMe() { return "Hallo"; } }. and test.ts : import app = require('../app/conf'); import * as...
Read more >Testing with typescript + jest + ts-jest - vercel/next.js - GitHub
'React' refers to a UMD global, but the current file is a module. Consider adding an import instead. Any ideas? 1
Read more >Google TypeScript Style Guide
This guide is based on the internal Google TypeScript style guide, but it has been slightly adjusted to remove Google-internal sections.
Read more >How setting up unit tests with TypeScript - Medium
Let's start with the project folder structure. root | node_modules | src | test | package.json | tsconfig.json. I considered a dedicated test ......
Read more >Jest Full and Partial Mock/Spy of CommonJS and ES6 Module ...
JavaScript import/require module testing do's and don'ts with Jest The example ... In that situation we were testing expect(mockDb.get).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I am currently redesigning the internal interface of expect. The type definition complexity of unitest’s expect was not good, so I am designing it to be as simple as possible.
Hopefully, I may be able to submit a Draft PR in the near future.
You can check this work in progress. https://github.com/TomokiMiyauci/expect.js
@kt3k Thanks for the response.
I will start working on the pull request. It may possibly be different from the current
unitest
implementation.