Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

285
Views
Jest vue3: SyntaxError: Unexpected token 'export' (signalr)

I am trying to connect tests to my project but they are not working

What can you do about it?

ERROR: Test suite failed to run Details:

   E:\Work\repos\WebRep\node_modules\@microsoft\signalr\dist\esm\index.js:3
   export { AbortError, HttpError, TimeoutError } from "./Errors";

   SyntaxError: Unexpected token 'export'

   > 1 | import * as signalR from '@microsoft/signalr/dist/esm/index';
       |  ^
     2 | import EventEmitter from '../helpers/event-emitter';
     3 | import * as scheduleNamespace from '../interfaces/schedules/schedules-dto';
     4 | import * as projectNamespace from '../interfaces/projects/projects-dto';

     at Runtime.createScriptFromCode (node_modules/jest-runtime/build/index.js:1597:14)
     at Object.<anonymous> (src/signalr-client/signalr.ts:1:2)

1

jest.config.js

// jest.config.js
const { pathsToModuleNameMapper } = require('ts-jest/utils');
// In the following statement, replace `./tsconfig` with the path to your `tsconfig` file
// which contains the path mapping (ie the `compilerOptions.paths` option):
const { compilerOptions } = require('./tsconfig');

module.exports = {
  preset: 'ts-jest',
  moduleFileExtensions: ['js', 'ts', 'tsx', 'json', 'node'],
  transform: {
    '.*\\.(vue)$': 'vue3-jest',
    '^.+\\.ts?$': 'ts-jest',
    '^.+\\.scss$': 'jest-scss-transform',
    '^.+\\.[t|j]sx?$': 'babel-jest',
  },
  transformIgnorePatterns: ['node_modules'],
  testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$',
  moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths, { prefix: '<rootDir>/' }),
  collectCoverage: true,
  testEnvironment: 'jsdom',
};
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!