Scheduler version - react_typescript test is not working

Show cool things you have done with our products
Post Reply
User avatar
Valentin
Posts: 4
Joined: Mon Feb 25, 2019 4:30 pm

Scheduler version - react_typescript test is not working

Post by Valentin » Mon Feb 25, 2019 4:39 pm

I took react_typescript example app run but the test doesn't work and got this in the console

FAIL src/App.test.tsx
● Test suite failed to run

Code: Select all

   Cannot find module 'bryntum-scheduler' from 'BryntumScheduler.tsx'
      
      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:179:17)
      at Object.<anonymous> (src/components/BryntumScheduler.tsx:5:27)

I tried to write a test for scheduler but no success.
please any suggestions, thanks

User avatar
Maxim Gorkovsky
Core Developer
Core Developer
Posts: 2788
Joined: Wed Jan 08, 2014 11:46 am

Re: Scheduler version - react_typescript test is not working

Post by Maxim Gorkovsky » Tue Feb 26, 2019 8:59 am

Hello.
Change "bryntum-scheduler" module definition in tsconfig.json to

Code: Select all

"bryntum-scheduler" : ["src/lib/scheduler/scheduler.module.transpiled.js"]
We will fix paths for next release, thank you for report

User avatar
Valentin
Posts: 4
Joined: Mon Feb 25, 2019 4:30 pm

Re: Scheduler version - react_typescript test is not working

Post by Valentin » Tue Feb 26, 2019 10:34 am

Hello and thanks for your reply.

Yes, I have a module definition in tsconfig, but still got the error.

"paths": {
"bryntum-scheduler" : ["src/lib/scheduler/scheduler.module.transpiled.js"]
}

User avatar
Maxim Gorkovsky
Core Developer
Core Developer
Posts: 2788
Joined: Wed Jan 08, 2014 11:46 am

Re: Scheduler version - react_typescript test is not working

Post by Maxim Gorkovsky » Tue Feb 26, 2019 3:21 pm

What kind of error do you have? What scheduler version do you use?

User avatar
Valentin
Posts: 4
Joined: Mon Feb 25, 2019 4:30 pm

Re: Scheduler version - react_typescript test is not working

Post by Valentin » Tue Feb 26, 2019 5:19 pm

Bryntum Scheduler 1.2.3

terminal

Code: Select all

FAIL  src/App.test.tsx
  ● Test suite failed to run

    Cannot find module 'bryntum-scheduler' from 'BryntumScheduler.tsx'
      
      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:179:17)
      at Object.<anonymous> (src/components/BryntumScheduler.tsx:5:27)
tsconfig.json

Code: Select all

{
  "compilerOptions": {
    "baseUrl": ".",
    "outDir": "build/dist",
    "module": "esnext",
    "target": "es5",
    "lib": ["es7", "dom"],
    "sourceMap": true,
    "allowJs": true,
    "jsx": "react",
    "moduleResolution": "node",
    "rootDir": "src",
    "forceConsistentCasingInFileNames": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noImplicitAny": true,
    "importHelpers": true,
    "strictNullChecks": true,
    "suppressImplicitAnyIndexErrors": true,
    "noUnusedLocals": true,
    "paths": {
      "bryntum-scheduler" : ["src/lib/scheduler/scheduler.module.transpiled.js"]
    }
  },
  "exclude": [
    "node_modules",
    "build",
    "scripts",
    "acceptance-tests",
    "webpack",
    "jest",
    "src/setupTests.ts"
  ]
}

User avatar
Maxim Gorkovsky
Core Developer
Core Developer
Posts: 2788
Joined: Wed Jan 08, 2014 11:46 am

Re: Scheduler version - react_typescript test is not working

Post by Maxim Gorkovsky » Wed Feb 27, 2019 12:37 pm

Yesterday we had a new scheduler 1.2.5 release with fixed react_typescript demo. Please try it, such problems should go away

Post Reply