Code build continues after build fails : <p>I'm building a CI/CD pipeline using git, codebuild and elastic beanstalk. </p>

<p>During codebuild execution when build fails due to syntax error of a test case, I see codebuild progress to next stage and ultimatly go on to produce the artifacts. </p>

<p>My understanding was if the build fails, execution should stop. is this a correct behavior ?</p>

<p>Please see the buildspec below.</p>

<pre><code>version: 0.2

phases:
  install:
    commands:
      - echo Installing package.json..
      - npm install
      - echo Installing Mocha...
      - npm install -g mocha
  pre_build:
    commands:
      - echo Installing source NPM placeholder dependencies...
  build:
    commands:
      - echo Build started on `date`
      - echo Compiling the Node.js code
      - mocha modules/**/tests/*.js
  post_build:
    commands:
      - echo Build completed on `date`
artifacts:
  files:
    - modules/*
    - node_modules/*
    - package.json
    - config/*
    - server.js
</code></pre>
