Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Can't get Jasmine 4 to support .jsx files #188

@EvHaus

Description

@EvHaus

Are you creating an issue in the correct repository?

I hope so. Only the core jasmine dependency is used to reproduce this.

Expected Behavior

Spec files with the .jsx extension should be loadable by jasmine@4 when used with babel.

Current Behavior

Trying to load a .jsx file throws:

TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".jsx" for /home/projects/node-pmddnq/spec/jsx.spec.jsx
    at Loader.t.defaultGetFormat [as _getFormat] (https://node-pmddnq.w.staticblitz.com/blitz.bc2b78560fa0e6097e7f69d4e820659cab64d2c5.js:6:731743)
    at Loader.getFormat (https://node-pmddnq.w.staticblitz.com/blitz.bc2b78560fa0e6097e7f69d4e820659cab64d2c5.js:6:865150)
    at Loader.getModuleJob (https://node-pmddnq.w.staticblitz.com/blitz.bc2b78560fa0e6097e7f69d4e820659cab64d2c5.js:6:866865)
    at Loader.import (https://node-pmddnq.w.staticblitz.com/blitz.bc2b78560fa0e6097e7f69d4e820659cab64d2c5.js:6:865920)
    at Jasmine._loadFiles (/home/projects/node-pmddnq/node_modules/jasmine/lib/jasmine.js:215:5)
    at Jasmine.loadSpecs (/home/projects/node-pmddnq/node_modules/jasmine/lib/jasmine.js:206:3)
    at Jasmine.execute (/home/projects/node-pmddnq/node_modules/jasmine/lib/jasmine.js:502:3)
    at runJasmine (/home/projects/node-pmddnq/node_modules/jasmine/lib/command.js:158:5)
    at Command.run (/home/projects/node-pmddnq/node_modules/jasmine/lib/command.js:57:9) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'

Possible Solution

Not sure. This wasn't a problem in [email protected], so maybe the new ESM changes in jasmine@4 are causing it?

Suite that reproduces the behavior (for bugs)

https://stackblitz.com/edit/node-pmddnq?file=README.md

Context

Makes v4 somewhat un-useable for React projects.

Your Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions