Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests in a file are not running when top-level describe is exported #317

Open
trusktr opened this issue Nov 9, 2020 · 1 comment
Open
Assignees
Labels
Question ❔ Further information is requested

Comments

@trusktr
Copy link
Contributor

trusktr commented Nov 9, 2020

I have some code like this:

export default describe('...', () => {
  test('...', () => {
    // ... this never runs ...
  })
})

and when I run asp, it does not execute any tests in side the describe block and the output is like this:

✔ src/as/renderers/webgl/WebGLRenderLists.spec.ts Pass: 0 / 0 Todo: 0 Time: 6.319ms
  [Result]: ✔ PASS
   [Files]: 1 total
  [Groups]: 1 count, 1 pass
   [Tests]: 0 pass, 0 fail, 0 total
    [Time]: 1745.893ms

(Note the 0 pass, 0 fail, 0 total.)

If I remove the export default, then the issue goes away:

describe('...', () => {
  test('...', () => {
    // ... this never runs ...
  })
})

and I get expected output:

✔ src/as/renderers/webgl/WebGLRenderLists.spec.ts Pass: 0 / 0 Todo: 0 Time: 6.319ms
  [Result]: ✖ FAIL
   [Files]: 1 total
  [Groups]: 5 count, 5 pass
   [Tests]: 1 pass, 4 fail, 5 total           <--- good, it ran the tests
    [Time]: 1975.077ms
@jtenner
Copy link
Contributor

jtenner commented Mar 1, 2021

The describe function is void. When you export the return value of a void function, this results in undefined assemblyscript behavior.

function noValue(): void {}

// should be a compile time error
export default noValue();

Please feel free to file an issue with the assemblyscript repo.

@jtenner jtenner self-assigned this Mar 1, 2021
@jtenner jtenner added the Question ❔ Further information is requested label Mar 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question ❔ Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants