From 327a57238dc034ebc1eee72bcfde1d8cfb2c5cf8 Mon Sep 17 00:00:00 2001 From: Brandon Casey <2381475+brandonocasey@users.noreply.github.com> Date: Mon, 22 Feb 2021 08:05:57 -0800 Subject: [PATCH] test: add playback-min as a unit test type (#1077) --- .github/workflows/ci.yml | 2 +- scripts/rollup.config.js | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83880ea7c..a0ab5c459 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - test-type: [unit, playback] + test-type: [unit, playback, playback-min] env: BROWSER_STACK_USERNAME: ${{secrets.BROWSER_STACK_USERNAME}} BROWSER_STACK_ACCESS_KEY: ${{secrets.BROWSER_STACK_ACCESS_KEY}} diff --git a/scripts/rollup.config.js b/scripts/rollup.config.js index d184c5f78..742c6c5ca 100644 --- a/scripts/rollup.config.js +++ b/scripts/rollup.config.js @@ -4,6 +4,8 @@ const {terser} = require('rollup-plugin-terser'); const createTestData = require('./create-test-data.js'); const replace = require('@rollup/plugin-replace'); +const CI_TEST_TYPE = process.env.CI_TEST_TYPE || ''; + let syncWorker; // see https://github.com/videojs/videojs-generate-rollup-config // for options @@ -35,6 +37,10 @@ const options = { defaults.test.unshift('worker'); defaults.test.unshift('createTestData'); + if (CI_TEST_TYPE === 'playback-min') { + defaults.test.push('uglify'); + } + // istanbul is only in the list for regular builds and not watch if (defaults.test.indexOf('istanbul') !== -1) { defaults.test.splice(defaults.test.indexOf('istanbul'), 1); @@ -84,13 +90,12 @@ const options = { } }; -if (process.env.CI_TEST_TYPE) { - if (process.env.CI_TEST_TYPE === 'playback') { - options.testInput = 'test/playback.test.js'; - } else { - options.testInput = {include: ['test/**/*.test.js'], exclude: ['test/playback.test.js']}; - } +if (CI_TEST_TYPE === 'playback' || CI_TEST_TYPE === 'playback-min') { + options.testInput = 'test/playback.test.js'; +} else if (CI_TEST_TYPE === 'unit') { + options.testInput = {include: ['test/**/*.test.js'], exclude: ['test/playback.test.js']}; } + const config = generate(options); if (config.builds.browser) {