venture23-aleo / doko-js

12 stars 3 forks source link

starter template does not compile #21

Closed olehmisar closed 4 days ago

olehmisar commented 2 months ago

dokojs version: 0.2

starter template generated by dokojs init my-project does not compile (because token program still uses finalize blocks).

If I fix the compilation, and try to run tests with npm run test, I get another problem.

$ npm run test

> dokojs-template@1.0.0 test
> node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --config jest.config.json --detectOpenHandles

 FAIL  test/token.test.ts
  ● Test suite failed to run

    ReferenceError: exports is not defined

      3 | global.console = console

      at test.config.js:5:23

 FAIL  test/sample_program.test.ts
  ● Test suite failed to run

    ReferenceError: exports is not defined

      3 | global.console = console

      at test.config.js:5:23

Test Suites: 2 failed, 2 total
Tests:       0 total
Snapshots:   0 total
Time:        2.34 s
Ran all test suites.
anilpdl commented 2 months ago

@olehmisar Can you downgrade the ts-jest version and try again? It seems some changes on ts-jest has caused the issue of exports is not defined, running npm install ts-jest@29.1 on generated project should hep fix it.

And regarding the outdated program on template, we will release the updated version of the sample contracts, we are testing for any further issues.

olehmisar commented 2 months ago

i'd advise you to move to vitest. You will not need babel, ts-jest and other dumb stuff anymore.