-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release: Bring back Rollup, Add coverage, Add browser test
Follows-up 3708273. Now that I've had a while to take inventory, I think we can bring this back to make distribution and re-use a bit easier for things like browserstack-runner. Highlights: * Switch from 'chalk' to 'kleur'. Kleur is a a dependency-free alternative that is safe to run in a browser environment without needing to do anything extra to emulate Node etc. Downstream browserstack-runner was having to mock the Node 'process' global previously because of this. There are ways around that, but it's naturally simplest to just not have any code that is just naturally agnostic of Node vs browser. Ref browserstack/browserstack-runner#179. * Use Karma to run the unit tests in the browser. * Use NYC to generate a code coverage report over the unit and integration tests.
- Loading branch information
Showing
16 changed files
with
4,017 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock.json binary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
/.nyc_output | ||
/coverage | ||
/dist | ||
/node_modules | ||
/log | ||
/*.log |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
module.exports = function (config) { | ||
const { nodeResolve } = require('@rollup/plugin-node-resolve'); | ||
const commonjs = require('@rollup/plugin-commonjs'); | ||
|
||
config.set({ | ||
files: [ | ||
'node_modules/sinon/pkg/sinon.js', | ||
'test/unit/tap-reporter.js', | ||
'test/unit/helpers.js' | ||
], | ||
preprocessors: { | ||
'test/unit/**.js': ['rollup'] | ||
}, | ||
rollupPreprocessor: { | ||
external: ['sinon'], | ||
output: { | ||
globals: { | ||
sinon: 'sinon' | ||
}, | ||
format: 'iife', | ||
name: 'JsReporters_Test', | ||
sourcemap: true | ||
}, | ||
plugins: [ | ||
// For 'events' and 'kleur' | ||
nodeResolve({ | ||
preferBuiltins: false | ||
}), | ||
commonjs({ | ||
// This makes require() work like in Node.js, | ||
// instead of wrapped in a {default:…} object. | ||
requireReturnsDefault: 'auto' | ||
}) | ||
] | ||
}, | ||
frameworks: ['qunit'], | ||
browsers: ['FirefoxHeadless', 'ChromeHeadless'], | ||
singleRun: true, | ||
autoWatch: false | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.