-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🔧 Migrate repo scripts to ESM * ♻ Migrate @percy/env to ESM * ♻ Migrate @percy/logger to ESM * ✅ Fix test usage of logger mocking helper * ✅ Fix test usage of core test helper * ♻ Migrate @percy/client to ESM * ✅ Fix test usage of client test helper * ♻ Migrate @percy/config to ESM * ♻ Migrate @percy/core to ESM * ➖ Remove nock dependency * ♻ Migrate @percy/cli-command to ESM * ♻ Migrate @percy/cli to ESM * ♻ Migrate @percy/cli-build to ESM * ♻ Migrate @percy/cli-config to ESM * ♻ Migrate @percy/cli-upload to ESM * ♻ Migrate @percy/cli-exec to ESM * ♻ Migrate @percy/cli-snapshot to ESM * ➖ Remove babel-plugin-module-resolver dependency * ♻ Migrate @percy/sdk-utils to ESM * 💚 Update CI workflows * ✅ Fix flakey tests * ✅ Use different test port to work around Windows CI * 🐛 Specify extension and use commonjs for CLI bin * 🐛 Reference dist in package import aliases And subsequently rewrite import aliases from dist to src in development * 🔨 Fix clean script
- Loading branch information
Showing
159 changed files
with
1,221 additions
and
1,063 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
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,29 @@ | ||
const cwd = process.cwd(); | ||
const path = require('path'); | ||
const pkg = require(`${cwd}/package.json`); | ||
|
||
module.exports = { | ||
overrides: [{ | ||
exclude: pkg.files && ( | ||
pkg.files.map(f => ( | ||
path.join(cwd, f) | ||
))), | ||
presets: [ | ||
['@babel/env', { | ||
modules: false, | ||
targets: { | ||
node: '14' | ||
} | ||
}] | ||
] | ||
}], | ||
env: { | ||
test: { | ||
plugins: [ | ||
['istanbul', { | ||
exclude: ['dist', 'test'] | ||
}] | ||
] | ||
} | ||
} | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
module.exports = async config => { | ||
const rollup = await import('./rollup.config.js'); | ||
|
||
return config.set({ | ||
basePath: process.cwd(), | ||
frameworks: ['jasmine'], | ||
reporters: ['mocha'], | ||
singleRun: true, | ||
concurrency: 1, | ||
|
||
browsers: [ | ||
'ChromeHeadless', | ||
'FirefoxHeadless' | ||
], | ||
|
||
files: [ | ||
// common files | ||
{ pattern: require.resolve('regenerator-runtime/runtime'), watched: false }, | ||
{ pattern: require.resolve('./scripts/test-helpers'), type: 'module', watched: false }, | ||
// local package files | ||
{ pattern: 'src/index.js', type: 'module', watched: false }, | ||
{ pattern: 'test/helpers.js', type: 'module', watched: false }, | ||
{ pattern: 'test/**/*.test.js', type: 'module', watched: false }, | ||
{ pattern: 'test/assets/**', watched: false, included: false } | ||
], | ||
|
||
proxies: { | ||
// useful when the contents of a fake asset do not matter | ||
'/_/': 'localhost/' | ||
}, | ||
|
||
// create dedicated bundles for src, test helpers, and each test suite | ||
preprocessors: { | ||
'src/index.js': ['rollup'], | ||
'test/helpers.js': ['rollupTestHelpers'], | ||
'test/**/*.test.js': ['rollupTestFiles'] | ||
}, | ||
|
||
client: { | ||
env: { | ||
// used in the test helper to add failed test debug logs | ||
DUMP_FAILED_TEST_LOGS: process.env.DUMP_FAILED_TEST_LOGS | ||
}, | ||
// reports look better when not randomized | ||
jasmine: { | ||
random: false | ||
} | ||
}, | ||
|
||
// (see rollup.config.js) | ||
rollupPreprocessor: rollup.test, | ||
|
||
customPreprocessors: { | ||
rollupTestHelpers: { | ||
base: 'rollup', | ||
options: rollup.testHelpers | ||
}, | ||
rollupTestFiles: { | ||
base: 'rollup', | ||
options: rollup.testFiles | ||
} | ||
}, | ||
|
||
plugins: [ | ||
'karma-chrome-launcher', | ||
'karma-firefox-launcher', | ||
'karma-jasmine', | ||
'karma-mocha-reporter', | ||
'karma-rollup-preprocessor' | ||
] | ||
}); | ||
}; |
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
Oops, something went wrong.