Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Problem with es6 modules #63

Closed
Closed
@ZielonyBuszmen

Description

@ZielonyBuszmen

Hi!
I have small problem with bs-jest.

In mybsconfig.json I have es6 modules:

  "package-specs": {    "module": "es6",    "in-source": true  },

When I run tests, it gives me the error like below:

$ jest FAIL  __tests__/Template_test.bs.js  ● Test suite failed to run    ....../node_modules/@glennsl/bs-jest/src/jest.js:3    import * as List from "bs-platform/lib/es6/list.js";    ^^^^^^    SyntaxError: Cannot use import statement outside a module      1 | // Generated by BUCKLESCRIPT, PLEASE EDIT WITH CARE      2 |     > 3 | import * as Jest from "@glennsl/bs-jest/src/jest.js";        | ^      4 |       5 | Jest.describe("TestSuite", (function (param) {      6 |         return Jest.test("test", (function (param) {      at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:537:17)      at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:579:25)      at Object.<anonymous> (__tests__/Template_test.bs.js:3:1)Test Suites: 1 failed, 1 totalTests:       0 totalSnapshots:   0 totalTime:        0.468s, estimated 2sRan all test suites.

When I changemodule tocommonjs, everything starts working. (I can't do this permamently, because I have own bindings, that not compatible withcommonjs)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp