-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* CHORE type module * CHORE * CHORE * FIX build * FIX * cHORE * FIX typecheck * CHORE * CHORE * FIX typing tests * CHORE * CHORE * CHORE * CHORE * CHORE * ADD stuff * FIX typings test * FIX lint * REMOVE deps * ADD deno test * FIX * FIX * FIX imports * FIX test * FIX test * FIX browser tests * FIX loki test * FIX testes * FIX root import * FIX newline * FIX karma test * FIX lint * FIX * FIX build * FIX perf tests * FIX test * FIX stuff * FIX deno tests * FIX require * FIX loki * FIX * FIX deno * FIX landingpage build * ADD side effects false * FIX deno * FIX async storage init * FIX init * FIX deno tests * FIX deno tests * FIX empty tests * ADD deno performance tests * FIX types * FIX test * FIX * FIX tests * FIX tests * FIX ci * FIX ci order * FIX test * FIX init * FIX lint * FIX deno tests
- Loading branch information
Showing
253 changed files
with
2,154 additions
and
1,952 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
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,131 @@ | ||
|
||
|
||
|
||
|
||
module.exports = async function (config) { | ||
|
||
|
||
// while the karma tests run, we need some things which we start here | ||
const { startTestServers, TEST_STATIC_FILE_SERVER_PORT } = await import('../test_tmp/helper/test-servers.js'); | ||
startTestServers(); | ||
|
||
const webpackConfig = await import('./karma.webpack.conf.cjs'); | ||
|
||
// karma config | ||
const configuration = { | ||
basePath: '', | ||
frameworks: [ | ||
'mocha', | ||
'webpack', | ||
'detectBrowsers' | ||
], | ||
webpack: webpackConfig.default, | ||
// Source files that you wanna generate coverage for. | ||
// Do not include tests or libraries (these files will be instrumented by Istanbul) | ||
preprocessors: { | ||
'../test_tmp/unit.test.js': ['webpack', 'sourcemap'] | ||
}, | ||
files: [ | ||
'../test_tmp/unit.test.js' | ||
], | ||
port: 9876, | ||
colors: true, | ||
autoWatch: false, | ||
|
||
/** | ||
* Serve these static files from the same port | ||
* so we can use it to server web-workers and stuff | ||
* and access them with same-origin-restricted code. | ||
*/ | ||
proxies: { | ||
'/files': 'http://localhost:' + TEST_STATIC_FILE_SERVER_PORT + '/files' | ||
}, | ||
/** | ||
* see | ||
* @link https://github.com/litixsoft/karma-detect-browsers | ||
*/ | ||
detectBrowsers: { | ||
enabled: true, | ||
usePhantomJS: false, | ||
postDetection: function (availableBrowser) { | ||
// respect cli args overwrites | ||
const indexOfBrowsers = process.argv.indexOf('--browsers'); | ||
if (indexOfBrowsers > 0) { | ||
return [process.argv[indexOfBrowsers + 1]]; | ||
} | ||
|
||
// return ['Chrome']; | ||
// return ['Firefox']; | ||
|
||
const doNotUseTheseBrowsers = [ | ||
'PhantomJS', | ||
'SafariTechPreview', | ||
'FirefoxAurora', | ||
'FirefoxNightly', | ||
'ChromeCanary' | ||
]; | ||
const browsers = availableBrowser | ||
.filter(b => !doNotUseTheseBrowsers.includes(b)); | ||
return browsers; | ||
} | ||
}, | ||
|
||
// Karma plugins loaded | ||
plugins: [ | ||
'karma-mocha', | ||
'karma-webpack', | ||
'karma-chrome-launcher', | ||
'karma-safari-launcher', | ||
'karma-firefox-launcher', | ||
'karma-ie-launcher', | ||
'karma-opera-launcher', | ||
'karma-detect-browsers', | ||
'karma-spec-reporter', | ||
'karma-sourcemap-loader' | ||
], | ||
client: { | ||
mocha: { | ||
bail: true, | ||
/** | ||
* Yes we need a really big value here | ||
* because the CI servers have a non-predictable | ||
* computation power and sometimes they can be really slow. | ||
*/ | ||
timeout: 120000 | ||
}, | ||
/** | ||
* Pass all env variables here, | ||
* so that they can be used in the browsers JavaScript process. | ||
* @link https://stackoverflow.com/a/38879184 | ||
*/ | ||
env: process.env | ||
}, | ||
browserDisconnectTimeout: 120000, | ||
processKillTimeout: 120000, | ||
singleRun: true, | ||
|
||
|
||
/** | ||
* Use this reported to fully log all test names | ||
* which makes it easier to debug. | ||
* @link https://github.com/tmcgee123/karma-spec-reporter | ||
*/ | ||
reporters: ['spec'] | ||
}; | ||
|
||
if (process.env.CI) { | ||
console.log('# Use CI settings.'); | ||
/** | ||
* overwrite reporters-default | ||
* So no big list will be shown at log | ||
*/ | ||
// configuration.reporters = []; | ||
|
||
// how many browser should be started simultaneously | ||
configuration.concurrency = 1; | ||
} | ||
|
||
|
||
config.set(configuration); | ||
}; | ||
|
Oops, something went wrong.