Our pure JavaScript Scheduler component


Post by coderboy@12 »

Hello

I am using bryntum controls and scheduler and whenever I try to run test related to that component I am getting like attached screenshot.

It would be good if anyone help me with this.

Thanks :)

Attachments
test.png
test.png (40.92 KiB) Viewed 1021 times

Post by tasnim »

Hi,

It's tough to say what's wrong with your app without seeing the code. Could you please upload a runnable test case so we can run and repro the issue and debug it?


Post by coderboy@12 »

Hi Tasnim,

Thanks for quick response, but do you want my original component file and it's test file ?

Is that enough ?


Post by alex.l »

Hi, we need your full application to be able reproduce this. It looks like a problem with your environment settings.
Try to googling this error text, it looks generic. Maybe this post might help you https://stackoverflow.com/questions/38296667/getting-unexpected-token-export
If you need our assistance, please attach runnable app and instructions how to build and reproduce this problem.

All the best,
Alex


Post by coderboy@12 »

Hi Alex,

Thanks for help, I've visited that link and none of the solution worked except the last one in which I have to transpile code from ESM to commonJS.

Can you please give me any refrence if anyone have already done so I take a look at the code, because I've tried saveral solution but it didn't worked and not sure if they are suitable for my config, So if you can help.

And I can't give my runnable app because we run that app on our organization platform and for that you need to have permissions for those which are confidential.

Thanks :)


Post by marcio »

Hey coderboy@12,

Could you please take a look at this post? I believe would help you with some explanation about it viewtopic.php?p=115809#p115809

Also, if you could assemble a sample project, like getting one of our demos, add some configuration like your application and share it here, that would help us a lot to assist you on the issue.

Best regards,
Márcio


Post by sergey.maltsev »

Hi!

Bryntum components require fully functional DOM.
It is not possible to test with virtual DOM implementation.


Post by rolandons »

Correct me if I'm wrong, but I believe this error Jest is encountering an unexpected token (typically a symptom of attempting to import a file Jest cannot parse) is due to Bryntum's code not being transpiled to ES5 and Jest not handling ES6 code out of the box. If this is the case, solutions would involve telling Jest to ignore/transform that library using transformIgnorePatterns in the Jest configuration. Maybe also necessary to tweak some settings in your Babel configuration.

Is this the reason why it's not possible to test Bryntum components with a virtual DOM implementation correct?

Last edited by rolandons on Thu Jun 29, 2023 9:08 pm, edited 1 time in total.

Post by sergey.maltsev »

Hi!

No, Jest is not compatible with Bryntum Components.
Please see my previous comment.
We use Siesta for tests.


Post by jim-skyral »

Soo are you saying we can't test any Bryntum products with jest?


Post Reply