Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

i use pipeline to test my node project , but i got an error with ...object , how can i fix it ?

andrew7810262000 January 17, 2019

i got an error below , how can i fix it ?

FAIL __tests__/router/workEvent-test.js
Test suite failed to run
/opt/atlassian/pipelines/agent/build/__tests__/router/workEvent-test.js:10
const body = { ...workEvent, date_str, timezone };
^^^

SyntaxError: Unexpected token ...

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

 

below is my test config file 

 

bitbucket-pipelines.yml

# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:8.0.0

pipelines:
default:
- step:
caches:
- node
services: # set up services in definitions
- mysql
- redis
script: # Modify the commands below to build your repository.
- npm install
- npm test
- npm install -g gulp
- gulp setup
- gulp recreate-db
- gulp dump-dev_data
- npm start

# set up db docker
definitions:
services:
mysql:
image: mysql
environment:
MYSQL_DATABASE: '******'
MYSQL_ROOT_PASSWORD: '******'
redis:
image: redis

 

1 answer

0 votes
Jeroen De Raedt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2019

Hi @andrew7810262000

do you also have this error when you run your build locally? 

Otherwise, make sure that the node version you are running locally matches the node version you have configured in Pipelines (node:8.0.0) 

andrew7810262000 January 21, 2019

npm test run ok , locally .

 

 

in my bitbucket-pipelines.yml i use 

image: node:8.0.0

 should any thing else i need to do in bitbucket-pipelines.yml  for configured  node:8.0.0 ? 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events