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.

TS2304 compilation errors when using 'describe' scoped variables

See original GitHub issue

Hello First, thanks for your work on as-pect. I am quite an assemblyscript newbie, I am not sure this is a real as-pect issue but when I declare a variable inside a describe block I cannot use it inside a testcase function:

describe("....", () => {
   const value: u8 = 42;
   it("should work", () => {
    expect<u8>(value).toBe(40 + 2);
   });

I get a compilation error as below:

ERROR TS2304: Cannot find name 'value'.
     expect<u8>(value).toBe(40 + 2);

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DuncanUszkay1commented, Apr 21, 2020
0reactions
jtennercommented, May 9, 2020

Closed stale. Feel free to reopen if there’s issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript getting error TS2304: cannot find name ' require'
I am getting the error "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page. I have...
Read more >
declare var test on global scope issue #1537 - GitHub
Both libraries have a test declaration on global scope, so TypeScript is throwing the following error: Error TS2403: Subsequent variable ...
Read more >
TypeScript errors and how to fix them
Below you find a list of common TypeScript errors along with the buggy code and its fixed ... Alternatively you can define a...
Read more >
cannot find name 'expect'.ts(2304) - You.com | The AI Search ...
You can search for the packages using the Definitely Typed package search. Open side panel. Error: TSError: ⨯ Unable to compile TypeScript.
Read more >
Trying TypeScript | Better world by better software
Setting up and starting with TypeScript and Visual Studio Code editor. ... We can catch this error using TypeScript compiler (and even ...
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