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.

Weird behaviour with imported sequence tests

See original GitHub issue

It seems like there’s something weird going on when a test is imported to be used in a plan of plans.

index.js

import zora from 'zora'
import example from './example.js'

zora()
.test(example)
.run()

example.js

import zora from 'zora'
export default zora({sequence: true})

.test('is run before', async assert => {
    await new Promise(resolve => setTimeout(() => resolve(), 1000))

    console.log('before')
    assert.ok(true, 'before')
})

.test('is run after', assert => {
    console.log('after')
    assert.ok(true, 'after')
})

Now, ‘after’ is logged at once, followed by ‘before’ after a second, if you run node -r @std/esm index.js.

If I append .run() and remove export default from example.js, and run it directly - it works! ‘before’ pops up first, followed by ‘after’.

Thought I’d let you know, even though the sequenced option is not yet documented 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lorenzofox3commented, Feb 7, 2018

No this is “normal” behaviour. For performance reasons tests are run in parallel (but reported in sequence). If you wish to respect the sequence you can pass the option {sequence:true} when you create your plan:

plan({sequence:true})
   .test('test1',async t=>{})
   .test('will not start before test 1 is done', t => {})
0reactions
olescommented, Feb 12, 2018

Ahh, great to know. Currently rolling with just a simple import './tests/set.js' - works for now!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Weird behaviour in 32bit mode with image sequences
I would like to know if someone is able to reproduce the issue I face. Import an image sequence in a 32bit project...
Read more >
Import image as sequence ignore most of the images #3585
Steps to reproduce the behavior: Click on import files select first image of sequence and click open Selec...
Read more >
Python 3.6 project structure leads to RuntimeWarning
Reading through the bug report, it appears that there is a double-import which happens, and this RuntimeWarning is correct in alerting the user....
Read more >
Testing SVA Properties and Sequences - Verification Gentleman
It compiles, but the behaviour is really strange and different from when importing from a package. Example: expect(my_if.prop). Are you allowed ...
Read more >
Weird audio problem from imported Avid sequence - Autodesk ...
Hello, Strangely I have imported an Avid aaf and randomly some of the audio on the timeline just doesn't have a waveform or...
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