Skip to content

Exit code is 0 instead of 1 when jest tests failed #21

@Will956

Description

@Will956

Hey 👋

We aim to use that SDK in order to run our jest tests on Browserstack, we run tests thanks to that command:

  "scripts": {
    "test": "browserstack-node-sdk jest tests/index.test.js"
  },

When running, the exit code is always 0 (because the last command came from browserstack-node-sdk and not jest) even if the jest tests fail. This is problematic within our CI because the job will always be green, our CI is configurated as follow:

version: 2.1

orbs:
  node: circleci/[email protected]

jobs:
  test-old-browsers:
    executor: node/default
    steps:
      - checkout
      - node/install-packages:
          with-cache: true
      - run: echo "export BROWSERSTACK_BUILD_NAME=$CIRCLE_BRANCH-$(date +%Y-%m-%d-%H:%M)" >> $BASH_ENV
      - run:
          command: npm run test
          name: Run old browsers tests

workflows:
  test-old-browsers-workflow:
    jobs:
      - test-old-browsers

I tried to use set -e but looks like it doesn't work 🤔

Do you have any clues about that ? Thanks 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions