Docs/CI / CD

Jenkins

Jenkins has no shortage of ways to run Node tests; this pipeline is the minimal declarative version. Credentials come from the Jenkins credentials store and surface as environment variables.

Jenkinsfilegroovy
pipeline {
  agent { docker { image 'node:20' } }

  environment {
    TEST_PASSWORD = credentials('assrt-test-password')
  }

  stages {
    stage('Install') {
      steps {
        sh 'npm ci'
        sh 'npx assrt install-browsers --with-deps'
      }
    }
    stage('Test') {
      steps {
        sh 'npx assrt run --reporter junit'
      }
    }
  }

  post {
    always {
      junit 'assrt-results/junit.xml'
      archiveArtifacts artifacts: 'assrt-results/**', allowEmptyArchive: true
    }
  }
}