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.

[Feature]: Testdeck supports jest, can we add link to it?

See original GitHub issue

🚀 Feature Proposal

Testdeck now supports jest.

It allows tests to be written in OOP style using decorators:

import { suite, test } from "@testdeck/jest";
import { expect } from 'chai';

@suite
class Hello {
  
  @test
  world() {
    expect(false).to.be.true;
  }
}

I would love to get some feedback and list the @testdeck/jest somewhere deep in the testdeck docs. This was initially authored for mocha as the mocha-typescript, but since we abstracted the underlying test runner and it now works with mocha, jest and jasmine. Here is where mocha listed it: https://github.com/mochajs/mocha/wiki#interfaces--reporters

Motivation

The main motivation is OOP first developers coming from Java, C#, Objective-C etc. to JavaScript default to preferring object oriented patterns to functional patterns. TypeScript decorators and class syntax enabled enabled using classes to define tests. The OOP syntax also allows some test fixtures to be defined in base classes and then be extended reusing the base functionality. With functional suites can not easily inherit and extend other suites, instead of inheritance devs should use composition.

Example

The @testdeck/jest exposes test UI that can be utilized like:

import { suite, test } from "@testdeck/jest";
import { expect } from 'chai';

@suite
class Hello {
  
  @test
  world() {
    expect(false).to.be.true;
  }
}

Pitch

This feature does not belong to the jest core platform. (or you may decide to implement similar UI) I am asking if we can add a link to the custom UI library in the jest docs, like we did with mocha.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mrazauskascommented, Oct 18, 2021

Looking at Mocha’s wiki, I thought @testdeck/jest fits perfectly inside awesome-jest list. It is already there together with many other great projects and resources: https://github.com/jest-community/awesome-jest#library-extensions

0reactions
github-actions[bot]commented, Nov 18, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

testdeck | Your one stop solution for object oriented testing ...
testdeck is a decorator based wrapper around your favourite JavaScript test framework. With testdeck, you can write your tests object-orientedly, ...
Read more >
How to add test cases for Link using jest /enzyme
Here Link will render based on the SearchLink props. As you are passing it as true, it wont be available in the DOM....
Read more >
How to mock an imported Typescript class with Jest
This is a quick post to get it working for Typescript if you're using Jest. If you're an Angular developer and have not...
Read more >
@testdeck/mocha | Yarn - Package Manager
import { suite, test } from "@testdeck/mocha"; import { expect } from 'chai'; ... #357 Closes #356: Add SonarCloud to check for code...
Read more >
testdeck/jest
You can use the standard jest watcher script. Further Reading. API · Object Oriented Testing · Generated Test Suites · Parameterised Tests ...
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