-
Notifications
You must be signed in to change notification settings - Fork 31
Jasmine 4.0.1 does not work with jasmine-ts #177
Comments
Jasmine 4 has many breaking changes. Have to work on the compatibility |
I think this library is outdated and generates more problems than solves. Jasmine@4 does not expose The loader is to be set before the node process starts. Otherwise this helper library has to start a new node process. But I think it is an overkill and gives an extra complexity to the jasmine, typescript and ts-node config management and debugging process. I think it is more clear if we use proper jasmine configuration, so I have created 2 example projects to demonstrate how to setup jasmine@4, typescript with commonjs and ES6 module resolution. |
Sorry for my late response, but your 2 examples really helped me to remove the jasmine-ts dependency. Thank u |
Update most packages, including webpack to v5. To make sure live reloads for dev mode works, tell the devserver to write files to disk. The "expected" webpack workflow is to have webpack know about every file that's part of the build, including CSS, images, and HTML. Then, the devserver bundles all of these together and provides mangled names for each file. Prettyscribe doesn't currently link all its files together in a way that makes webpack happy. I tried turning links into imports that webpack can manage, but that change is bigger and more complex. Side note, jasmine package is still on the older v3, since v4 doesn't support jasmine-ts. Soln for that is in svi3c/jasmine-ts#177 (comment), but on first pass I couldn't get it to work.
Update Jasmine to v4, and update package-lock.json to latest version since a bunch of other deps were recently updated. Drop jasmine-ts dep (it doesn't work with jasmine v4) and follow suggestion from svi3c/jasmine-ts#177 (comment) to get TypeScript files working. TIL package-lock.json is supposed to be committed to the repo: https://nodejs.dev/learn/the-package-lock-json-file
@ert78gb Not sure if I'm doing something wrong, but I tried your commonjs example and still get:
when running unit tests My guess is that it's not picking up my helper script. |
Hi, The example perfectly works for me. If I upgrade every dependency to the latest stable then it still works. Are you sure did you setup everything correctly? |
@ert78gb yeah I followed everything exactly. This is my jasmine.json:
Even when I delete |
In my example I don't use In WebStorm I open the package.json and I click on the small play icon before the In VsCode Insider I use the |
When I upgrade to Jasmine 4.0.1 I get the following error:
The text was updated successfully, but these errors were encountered: