Coder Social home page Coder Social logo

type error in test runner about kataw HOT 9 CLOSED

kataw avatar kataw commented on June 18, 2024
type error in test runner

from kataw.

Comments (9)

aladdin-add avatar aladdin-add commented on June 18, 2024 1

not sure why. maybe another "windows-compat" issue. ╮( ̄▽ ̄)╭

a workaround could be setting "target" to >="es2017", to avoid compiling async functions to regenerator.

from kataw.

aladdin-add avatar aladdin-add commented on June 18, 2024

can you describe how you get this error, and the raw output?

from kataw.

KFlash avatar KFlash commented on June 18, 2024

I simply wrote a test and tried to test it. Then the test runner froze and after a few sec that messages pops up. I got confused because '30 if (!(t = _.trys, t = t.length > 0' has nothing to do with Kataw source code or the test runner.

I modified the tests, and it works now except I need to update all the time. Normal testing are broken - always complaining about mismatch.

Anyway. This is common TS issue. I guess related to something in ts-node library

from kataw.

KFlash avatar KFlash commented on June 18, 2024

I was wrong. It points to some code in ts-lib. Not ts-node.

Closest I got in tracking it is this issue egoist/bili#280

from kataw.

KFlash avatar KFlash commented on June 18, 2024

@aladdin-add It's related to async/await

TypeStrong/ts-node#774

from kataw.

KFlash avatar KFlash commented on June 18, 2024

I tried to run coverage

test/cli.ts:30:111 - error TS2322: Type 'number' is not assignable to type '{ label: number; sent: () => any; trys: any[]; ops: any[]; }'.

30 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
~
at createTSError (D:\x\node_modules\ts-node\src\index.ts:513:12)
at reportTSError (D:\x\node_modules\ts-node\src\index.ts:517:19)

from kataw.

aladdin-add avatar aladdin-add commented on June 18, 2024

the code was compiled twice? TypeStrong/ts-node#774 (comment)

but why? I was not able to repro on my macos, can you share the command that you used to run?

from kataw.

KFlash avatar KFlash commented on June 18, 2024

I only tried to run code coverage. 'npm run coverage'

from kataw.

KFlash avatar KFlash commented on June 18, 2024

@aladdin-add is there a fix for this? And what's the test runner update?

from kataw.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.