3 Star 9 Fork 3

Gitee 极速下载/crawlee

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/apify/crawlee
克隆/下载
vitest.config.ts 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
import { resolve } from 'node:path';
import isCI from 'is-ci';
import tsconfigPaths from 'vite-tsconfig-paths';
// @ts-ignore
import { defineConfig } from 'vitest/config';
let threads: { minThreads: number; maxThreads: number } | undefined;
if (isCI) {
// eslint-disable-next-line no-console
console.log(`Running in CI, throttling threads to 1 test at a time`);
threads = { minThreads: 1, maxThreads: 1 };
}
export default defineConfig({
plugins: [tsconfigPaths()],
esbuild: {
target: 'es2022',
keepNames: true,
},
test: {
globals: true,
coverage: {
provider: 'v8',
reporter: ['text', 'lcov', 'cobertura'],
exclude: ['**/node_modules/**', '**/dist/**', '**/test/**'],
},
restoreMocks: true,
...threads,
testTimeout: 60_000,
hookTimeout: 60_000,
alias: [
{ find: 'crawlee', replacement: resolve(__dirname, './packages/crawlee/src') },
{ find: '@crawlee/basic', replacement: resolve(__dirname, './packages/basic-crawler/src') },
{ find: '@crawlee/browser', replacement: resolve(__dirname, './packages/browser-crawler/src') },
{ find: '@crawlee/http', replacement: resolve(__dirname, './packages/http-crawler/src') },
{ find: '@crawlee/linkedom', replacement: resolve(__dirname, './packages/linkedom-crawler/src') },
{ find: '@crawlee/jsdom', replacement: resolve(__dirname, './packages/jsdom-crawler/src') },
{ find: '@crawlee/cheerio', replacement: resolve(__dirname, './packages/cheerio-crawler/src') },
{ find: '@crawlee/playwright', replacement: resolve(__dirname, './packages/playwright-crawler/src') },
{ find: '@crawlee/puppeteer', replacement: resolve(__dirname, './packages/puppeteer-crawler/src') },
{ find: /^@crawlee\/(.*)\/(.*)$/, replacement: resolve(__dirname, './packages/$1/$2') },
{ find: /^@crawlee\/(.*)$/, replacement: resolve(__dirname, './packages/$1/src') },
{ find: /^test\/(.*)$/, replacement: resolve(__dirname, './test/$1') },
],
retry: process.env.RETRY_TESTS ? 3 : 0,
},
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/mirrors/crawlee.git
[email protected]:mirrors/crawlee.git
mirrors
crawlee
crawlee
master

搜索帮助