diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a26e4a2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Tests + +on: [push, pull_request] + +env: + FORCE_COLOR: 2 + +jobs: + run: + name: Node ${{ matrix.node }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node: [8, 10, 12, 14] + + steps: + - name: Clone repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + + - name: Install npm dependencies + run: npm ci + + - name: Run tests + run: npm test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 91a48d1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: node_js - -node_js: - - "8" - - "10" - - "12" - - "14" - -services: - - xvfb - -env: - global: - - DISPLAY=:99.0 - -addons: - firefox: latest diff --git a/README.md b/README.md index 183a89f..8abc560 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/karma-runner/karma-qunit) [![npm version](https://img.shields.io/npm/v/karma-qunit.svg?style=flat-square)](https://www.npmjs.com/package/karma-qunit) [![npm downloads](https://img.shields.io/npm/dm/karma-qunit.svg?style=flat-square)](https://www.npmjs.com/package/karma-qunit) -[![Build Status](https://img.shields.io/travis/karma-runner/karma-qunit/master.svg?style=flat-square)](https://travis-ci.org/karma-runner/karma-qunit) [![peerDependencies Status](https://img.shields.io/david/peer/karma-runner/karma-qunit.svg?style=flat-square)](https://david-dm.org/karma-runner/karma-qunit?type=peer) [![devDependency Status](https://img.shields.io/david/dev/karma-runner/karma-qunit.svg?style=flat-square)](https://david-dm.org/karma-runner/karma-qunit?type=dev) +[![Build Status](https://img.shields.io/github/workflow/status/karma-runner/karma-qunit/Tests/master?style=flat-square)](https://github.com/karma-runner/karma-qunit/actions?workflow=Tests) > Adapter for the [QUnit](https://qunitjs.com/) testing framework. diff --git a/examples/simple/karma.conf.js b/examples/simple/karma.conf.js index ca16222..b0dee18 100644 --- a/examples/simple/karma.conf.js +++ b/examples/simple/karma.conf.js @@ -17,7 +17,7 @@ module.exports = function (config) { autoWatch: false, - browsers: ['Chrome'], + browsers: process.env.CI ? ['ChromeHeadless'] : ['Chrome'], singleRun: false, diff --git a/karma.conf.js b/karma.conf.js index d7201ef..c8da3e5 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,3 +1,6 @@ +var FIREFOX = process.env.CI ? ['FirefoxHeadless'] : ['Firefox'] +var CHROME = process.env.CI ? ['ChromeHeadless'] : ['Chrome'] + module.exports = function (config) { config.set({ frameworks: ['jasmine'], @@ -7,7 +10,14 @@ module.exports = function (config) { 'test/src/*.js' ], - browsers: process.env.TRAVIS ? ['Firefox'] : ['Chrome'], + browsers: process.env.CI ? FIREFOX : CHROME, + + customLaunchers: { + FirefoxHeadless: { + base: 'Firefox', + flags: ['-headless'] + } + }, autoWatch: true })