CircleCI npm测试失败,错误超过20000ms

时间:2019-05-17 12:33:23

标签: node.js unit-testing continuous-integration circleci circleci-2.0

我是CircleCI的初学者。我想将我的项目与CircleCI集成在一起。每当运行npm test时,测试都会失败,并在CircleCI中出现以下错误。

any

我正在使用Mocha和Chai测试框架。我使用以下命令运行测试:

Error: Timeout of 15000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/circleci/repo/test/api/client/login-test.js)

这是我的CircleCi "script":{ "test": "mocha test/**/**/*.js --timeout 15000 --exit" } 文件

config.yml

我错过了配置中的任何内容吗?

这是我的单元测试

version: 2
jobs:
  build:
    docker:
      # specify the version you desire here
      - image: circleci/node:10.15.3

    working_directory: ~/repo

    steps:
      - checkout

      # Download and cache dependencies
      - restore_cache:
          keys:
            - v1-dependencies-{{ checksum "package.json" }}
            # fallback to using the latest cache if no exact match is found
            - v1-dependencies-

      - run: npm install

      - save_cache:
          paths:
            - node_modules
          key: v1-dependencies-{{ checksum "package.json" }}

      # run tests!
      - run: npm test

0 个答案:

没有答案