mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2025-01-23 05:44:46 +01:00
114 lines
3.1 KiB
JavaScript
114 lines
3.1 KiB
JavaScript
'use strict';
|
|
|
|
var stdEnv = require('std-env');
|
|
var vite = require('vite');
|
|
|
|
var _a;
|
|
typeof process < "u" && typeof process.stdout < "u" && !((_a = process.versions) == null ? void 0 : _a.deno) && !globalThis.window;
|
|
|
|
const defaultInclude = ["**/*.{test,spec}.?(c|m)[jt]s?(x)"];
|
|
const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**", "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*"];
|
|
const defaultCoverageExcludes = [
|
|
"coverage/**",
|
|
"dist/**",
|
|
"packages/*/test?(s)/**",
|
|
"**/*.d.ts",
|
|
"cypress/**",
|
|
"test?(s)/**",
|
|
"test?(-*).?(c|m)[jt]s?(x)",
|
|
"**/*{.,-}{test,spec}.?(c|m)[jt]s?(x)",
|
|
"**/__tests__/**",
|
|
"**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*",
|
|
"**/.{eslint,mocha,prettier}rc.{?(c|m)js,yml}"
|
|
];
|
|
const coverageConfigDefaults = {
|
|
provider: "v8",
|
|
enabled: false,
|
|
clean: true,
|
|
cleanOnRerun: true,
|
|
reportsDirectory: "./coverage",
|
|
exclude: defaultCoverageExcludes,
|
|
reportOnFailure: true,
|
|
reporter: [["text", {}], ["html", {}], ["clover", {}], ["json", {}]],
|
|
// default extensions used by c8, plus '.vue' and '.svelte'
|
|
// see https://github.com/istanbuljs/schema/blob/master/default-extension.js
|
|
extension: [".js", ".cjs", ".mjs", ".ts", ".mts", ".cts", ".tsx", ".jsx", ".vue", ".svelte"]
|
|
};
|
|
const fakeTimersDefaults = {
|
|
loopLimit: 1e4,
|
|
shouldClearNativeTimers: true,
|
|
toFake: [
|
|
"setTimeout",
|
|
"clearTimeout",
|
|
"setInterval",
|
|
"clearInterval",
|
|
"setImmediate",
|
|
"clearImmediate",
|
|
"Date"
|
|
]
|
|
};
|
|
const config = {
|
|
allowOnly: !stdEnv.isCI,
|
|
watch: !stdEnv.isCI,
|
|
globals: false,
|
|
environment: "node",
|
|
threads: true,
|
|
clearMocks: false,
|
|
restoreMocks: false,
|
|
mockReset: false,
|
|
include: defaultInclude,
|
|
exclude: defaultExclude,
|
|
testTimeout: 5e3,
|
|
hookTimeout: 1e4,
|
|
teardownTimeout: 1e4,
|
|
isolate: true,
|
|
watchExclude: ["**/node_modules/**", "**/dist/**"],
|
|
forceRerunTriggers: [
|
|
"**/package.json/**",
|
|
"**/{vitest,vite}.config.*/**"
|
|
],
|
|
update: false,
|
|
reporters: [],
|
|
silent: false,
|
|
hideSkippedTests: false,
|
|
api: false,
|
|
ui: false,
|
|
uiBase: "/__vitest__/",
|
|
open: true,
|
|
css: {
|
|
include: []
|
|
},
|
|
coverage: coverageConfigDefaults,
|
|
fakeTimers: fakeTimersDefaults,
|
|
maxConcurrency: 5,
|
|
dangerouslyIgnoreUnhandledErrors: false,
|
|
typecheck: {
|
|
checker: "tsc",
|
|
include: ["**/*.{test,spec}-d.?(c|m)[jt]s?(x)"],
|
|
exclude: defaultExclude
|
|
},
|
|
slowTestThreshold: 300
|
|
};
|
|
const configDefaults = Object.freeze(config);
|
|
|
|
function defineConfig(config) {
|
|
return config;
|
|
}
|
|
function defineProject(config) {
|
|
return config;
|
|
}
|
|
function defineWorkspace(config) {
|
|
return config;
|
|
}
|
|
|
|
Object.defineProperty(exports, 'mergeConfig', {
|
|
enumerable: true,
|
|
get: function () { return vite.mergeConfig; }
|
|
});
|
|
exports.configDefaults = configDefaults;
|
|
exports.coverageConfigDefaults = coverageConfigDefaults;
|
|
exports.defaultExclude = defaultExclude;
|
|
exports.defaultInclude = defaultInclude;
|
|
exports.defineConfig = defineConfig;
|
|
exports.defineProject = defineProject;
|
|
exports.defineWorkspace = defineWorkspace;
|