Working example of aurelia-testing 1.0.0-beta.4.0.0 with ES6, jest and typescript?


#1

Can anyone point me to a working example of aurelia-testing 1.0.0-beta.4.0.0 with ES6, jest and typescript?

I am particularly interested in the package.json file and the versions of the various libraries that are compatible.

The jest/Aurelia/typescript/ES6 ecosystem of packages seems to be extremely fragile.

I am having problems such as this one.

I also need to understand how to enable jest to deal with “SyntaxError: Unexpected token export” in an ES6 javascript library that we’re using.

Thanks!


#2

Hello,

Please see Aurelia Toolbelt. We are using Jest for testing. You can find the correct configuration there.

jest.config.json
jest.setup.ts

Although, you can see this post and Aurelia Testing With Jest
too.


#3

Thanks, @HamedFathi

I don’t see where any of the examples you gave are using the aurelia-testing package except this one:

[SOLVED] Problem with testing aurelia components using "jest",

which I had seen before but wasn’t making much progress with it.


#4

Did you try this? Jest Test

We had created this for [SOLVED] Problem with testing aurelia components using “jest”

I checked it again for you and works perfectly with TS and Jest. See the result

We had a problem with downloading npm_modules If you want to have a working sample (included npm_modules) without a problem you should download this. (I uploaded for you :slight_smile: )

Extract that and execute npm test. It should work like above picture
I believe you can learn about Aurelia testing, Typescript and Jest integration with it.