question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider adding "testing/expect.ts" module

See original GitHub issue

Jest 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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:30 (30 by maintainers)

github_iconTop GitHub Comments

1reaction
TomokiMiyaucicommented, Nov 15, 2022

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

1reaction
TomokiMiyaucicommented, Jun 2, 2022

@kt3k Thanks for the response.

I will start working on the pull request. It may possibly be different from the current unitest implementation.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found