Skip to content

Tests fails immediately after bootstrap #2347

@pomle

Description

@pomle

Version

3.0.1

Reproduction link

https://github.com/pomle/vue-test-fail-bug

Node and OS info

Node 10.2.1, Yarn 1.7.0

Steps to reproduce

  1. Run vue create [app].
  2. Run yarn run test:unit

Full cli output presented below.

➜ Development vue create amuse-alfre6

Vue CLI v3.0.1
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, TS, Router, CSS Pre-processors, Linter, Unit, E2E
? Use class-style component syntax? Yes
? Use Babel alongside TypeScript for auto-detected polyfills? Yes
? Use history mode for router? (Requires proper server setup for index fallback in production) Yes
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): SCSS/SASS
? Pick a linter / formatter config: TSLint
? Pick additional lint features: Lint on save
? Pick a unit testing solution: Jest
? Pick a E2E testing solution: Cypress
? Where do you prefer placing config for Babel, PostCSS, ESLint, etc.? In package.json
? Save this as a preset for future projects? Yes
? Save preset as: pontus-first-vue-test

Vue CLI v3.0.1
✨ Creating project in /Users/pom/Development/amuse-alfre6.
🗃 Initializing git repository...
⚙ Installing CLI plugins. This might take a while...

yarn install v1.7.0
info No lockfile found.
[1/4] 🔍 Resolving packages...
⠁ (node:78925) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 📃 Building fresh packages...
success Saved lockfile.
✨ Done in 164.43s.
🚀 Invoking generators...
📦 Installing additional dependencies...

yarn install v1.7.0
[1/4] 🔍 Resolving packages...
⠁ (node:78974) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 📃 Building fresh packages...
success Saved lockfile.
✨ Done in 25.88s.
⚓ Running completion hooks...

📄 Generating README.md...

🎉 Successfully created project amuse-alfre6.
👉 Get started with the following commands:

$ cd amuse-alfre6
$ yarn serve

➜ Development cd amuse-alfre6
➜ amuse-alfre6 git:(master) yarn run test:unit
yarn run v1.7.0
$ vue-cli-service test:unit
FAIL tests/unit/HelloWorld.spec.ts
● Test suite failed to run

/Users/pom/Development/amuse-alfre6/tests/unit/HelloWorld.spec.ts:3
import "core-js/modules/es6.array.iterator";
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

SyntaxError: Unexpected string

  at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/script_transformer.js:403:17)

Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 1.4s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What is expected?

Test should succeed.

What is actually happening?

Tests fail.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions