Added some tests

This commit is contained in:
2021-06-23 22:30:45 +02:00
parent 24f897e907
commit 3d3d7fae48
3796 changed files with 218744 additions and 3 deletions

30
tests/node_modules/tape-es/bin/tape-es.js generated vendored Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env node
import cli from 'commander'
import { runAll } from '../src/runners.js'
import { match, readPkg } from '../src/util/index.js'
const DEFAULT_PATTERN = '**/*.spec.js'
const DEFAULT_IGNORE = '**/node_modules/**'
const DEFAULT_ROOT = process.cwd()
const DEFAULT_THREADS = 10;
(async () => {
const pkg = await readPkg()
cli.version(pkg.version)
.arguments('[pattern]')
.option('-i, --ignore [value]', 'Ignore files pattern')
.option('-r, --root [value]', 'The root path')
.option('-t, --threads [number]', 'Number of threads to run tests concurrently', parseInt)
.parse(process.argv)
const pattern = cli.args[0] ? cli.args[0] : DEFAULT_PATTERN
const ignore = cli.ignore ? cli.ignore : DEFAULT_IGNORE
const root = cli.root ? cli.root : DEFAULT_ROOT
const threads = cli.threads ? cli.threads : DEFAULT_THREADS
const tests = await match(pattern, ignore, root)
await runAll(tests, threads, root)
})().catch(e => {
console.error(e)
})

33
tests/node_modules/tape-es/bin/tape-watch-es.js generated vendored Executable file
View File

@@ -0,0 +1,33 @@
#!/usr/bin/env node
import cli from 'commander'
import chokidar from 'chokidar'
import { run } from '../src/runners.js'
import { readPkg } from '../src/util/index.js'
const DEFAULT_PATTERN = '**/*.spec.js'
const DEFAULT_IGNORE = '**/node_modules/**'
const DEFAULT_ROOT = process.cwd();
(async () => {
const pkg = await readPkg()
cli.version(pkg.version)
.arguments('[pattern]')
.option('-i, --ignore [value]', 'Ignore files pattern')
.option('-r, --root [value]', 'The root path')
.parse(process.argv)
const pattern = cli.pattern ? cli.pattern : DEFAULT_PATTERN
const ignore = cli.ignore ? cli.ignore : DEFAULT_IGNORE
const root = cli.root ? cli.root : DEFAULT_ROOT
const watcher = chokidar.watch(pattern, {
ignored: [ignore],
persistent: true,
ignoreInitial: true,
cwd: root
})
watcher.on('all', (event, path, stat) => run(path, root))
})().catch(e => {
console.error(e)
})