kata-machine icon indicating copy to clipboard operation
kata-machine copied to clipboard

Cannot find module '@code/LinearSearchList'

Open HossamMuhammedOmar opened this issue 2 years ago • 6 comments

Hello,

When I tried to test the search linear algorithm by running the command npx jest Linear, I received the error message

Cannot find module '@code/LinearSearchList' or its corresponding type declarations.

Capture

HossamMuhammedOmar avatar Nov 08 '22 07:11 HossamMuhammedOmar

same things is happaning on here

zohaibhu avatar Nov 09 '22 14:11 zohaibhu

I ran node scripts/generate.js 2 and the code was generated in src/day2

panuwizzle avatar Nov 10 '22 10:11 panuwizzle

Hi!

  • Fix your code: You should pass your code to test. If you have a structure: src_tests_\YourTestFile src\day1\YourFileName Put it in your test instead @code/YourFileName; In my case: kataproblem
  • Or try to generate files with the script: node scripts/generate

MrsLecter avatar Nov 10 '22 10:11 MrsLecter

Not sure if this helps. When I cloned the repo I had to follow the Primes/Kata-machine github Read.me instructions. e.g. I had to update the ligma.js file etc and install ts-jest to get tests running: https://kulshekhar.github.io/ts-jest/docs/getting-started/installation/

leshec avatar Dec 12 '22 23:12 leshec

  1. npm install
  2. npm run generate
  3. npx jest "algorithm test file" - i.e npx run LinearSearchList

jonathanochaya avatar Aug 04 '23 15:08 jonathanochaya

I had a similar issue after doing yarn install again (which created "day2"..) - but then wanting to re-run some code from day1. I manually edited the paths within .jest.config.json and tsconfig.json which fixed it.

JanWartenberg avatar Oct 07 '23 15:10 JanWartenberg