Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

test does not have done callback. #216

Closed
ardok opened this issue Apr 3, 2019 · 2 comments
Closed

test does not have done callback. #216

ardok opened this issue Apr 3, 2019 · 2 comments

Comments

@ardok
Copy link

ardok commented Apr 3, 2019

test does not have done callback. Instead, it is now assert.

This would probably make case #189 stronger.

Type of issue

Eh, could be feature or bug. I view this as a bug. But others might see this as a feature.

Description

Keep test API the same as jest's one. That is:

// Maybe `assert` should be the 2nd param here.
test('foo', (done, assert) => {});

// Or to keep it from "breaking change"
test('foo', (assert, done) => {});

// Or like this if we want to deviate a bit from `jest`
test('foo', ({ done, assert }) => {});

Or maybe, make it so that import { test } from 'fusion-test-utils' does not override the actual test and it from jest.

So, we could do something like:

// I think it should just be import { fTest } right away, but whatever
import { test as fTest } from 'fusion-test-utils';

// Basically have `done` and `assert` available somehow
fTest('foo', (assert, done) => {});

// But we can also use regular jest's test
test('foo', (done) => {});
it('foo', (done) => {});

Current behavior

test('foo', (done) => {
  console.log('this prints');
  setTimeout(() => {
    console.log('why does this not print');
    done();
  }, 1000);
});

Expected behavior

test('foo', (done) => {
  console.log('this prints');
  setTimeout(() => {
    console.log('this should also print');
    done();
  }, 1000);
});

Steps to reproduce

Just run that test and see the console.log prints

Your environment

  • fusion-test-utils version:
    fusion-test-utils@^1.3.1, fusion-test-utils@^1.4.1:
    version "1.4.1"

  • Node.js version (node --version): 10.15.3

  • npm version (npm --version): 6.4.1

  • Operating System: OSX 10.14.4

@mlmorg
Copy link

mlmorg commented Apr 3, 2019

I would recommend we close this in favor of #189. We plan to expose Jest directly and remove the wrapper.

@ardok
Copy link
Author

ardok commented Apr 3, 2019

@mlmorg sounds good. Feel free to close this

@mlmorg mlmorg closed this as completed Apr 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants