generated from darkobits/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnr.config.ts
70 lines (59 loc) · 2.22 KB
/
nr.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import { defineConfig } from '@darkobits/nr'
import { defaultPackageScripts } from '@darkobits/ts'
import IS_CI from 'is-ci'
export default defineConfig([
defaultPackageScripts,
({ script, command }) => {
script('test.smoke', [[
// ----- [Smoke Tests] CJS Host Package --------------------------------
// Using a .ts Extension; should compile with esbuild.
// command.node('test.js', {
// name: 'tests:cjs:ts-extension',
// cwd: 'tests/fixtures/cjs/ts-extension'
// }),
// Using a .mts extension; should compile with esbuild.
// command.node('test.js', {
// name: 'tests:cjs:mts-extension',
// cwd: 'tests/fixtures/cjs/mts-extension'
// }),
// Using an .mjs extension; should load with import().
// command.node('test.js', {
// name: 'tests:cjs:mjs-extension',
// cwd: 'tests/fixtures/cjs/mjs-extension'
// }),
// Using a .js extension; should compile with esbuild, loading issues a
// node:35129 warning.
// command.node('test.js', {
// name: 'tests:cjs:js-extension',
// cwd: 'tests/fixtures/cjs/js-extension'
// }),
// ----- [Smoke Tests] ESM Host Package --------------------------------
// Using a .ts extension; should compile with esbuild.
command.node('test.js', {
name: 'tests:esm:ts-extension',
cwd: 'tests/fixtures/esm/ts-extension'
}),
// Using a .js extension; should load with import().
command.node('test.js', {
name: 'tests:esm:js-extension',
cwd: 'tests/fixtures/esm/js-extension'
}),
// Using a .cjs extension; should compile with esbuild, loading issues a
// node:35129 warning.
command.node('test.js', {
name: 'tests:esm:cjs-extension',
cwd: 'tests/fixtures/esm/cjs-extension'
}),
// Using a .cts extension; should compile with esbuild.
command.node('test.js', {
name: 'tests:esm:cts-extension',
cwd: 'tests/fixtures/esm/cts-extension'
})
]], {
group: 'Test',
description: 'Runs various tests on the built version of the project.',
timing: true
})
if (!IS_CI) script('postBuild', ['script:test.smoke'] )
}
])