-
Notifications
You must be signed in to change notification settings - Fork 6
/
run
executable file
·106 lines (83 loc) · 2.63 KB
/
run
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/usr/bin/env bash
set -euo pipefail
root=`dirname "$0"`
root=`node -r fs -p "fs.realpathSync(process.argv[1]);" "$root"`
. "$root/../../node_modules/faucet-pipeline-core/test/cli_harness.sh"
begin "$root/test_basic"
faucet
assert_identical "./dist/bundle.js" "./expected.js"
end
begin "$root/test_basic" # once more with fingerprinting
faucet --fingerprint
assert_identical "./dist/bundle-56a55e40e1b060b637dba590df3ff10b.js" "./expected.js"
end
begin "$root/test_transpilation"
faucet
assert_identical "./dist/bundle.js" "./expected.js"
end
begin "$root/test_sourcemap"
faucet --sourcemaps
assert_identical_sourcemap "./dist/bundle.js" "./expected.js" "./expected.js.map"
end
begin "$root/test_jsx"
faucet
assert_identical "./dist/bundle.js" "./expected.js"
end
begin "$root/test_typescript"
faucet
assert_identical "./dist/bundle.js" "./expected.js"
end
begin "$root/test_browserslist"
faucet
assert_identical "./dist/bundle.js" "./expected.js"
assert_identical "./dist/bundle_alt.js" "./expected_legacy.js"
assert_identical "./dist/bundle_legacy.js" "./expected_legacy.js"
end
begin "$root/test_multi"
faucet
assert_identical "./dist/foo.js" "./expected_foo.js"
assert_identical "./dist/bar.js" "./expected_bar.js"
assert_json "./dist/manifest.json" "./expected.json"
end
begin "$root/test_manifest"
faucet --fingerprint
assert_identical "./dist/manifest.json" "./expected.json"
end
begin "$root/test_manifest_uris"
faucet --fingerprint
assert_json "./dist/manifest.json" "./expected.json"
end
begin "$root/test_fingerprinting"
faucet --fingerprint
assert_identical "./dist/bundle-56a55e40e1b060b637dba590df3ff10b.js" "./expected.js"
assert_identical "./dist/bundle_alt.js" "./expected.js"
end
begin "$root/test_bundle_customization"
faucet
assert_identical "./dist/bundle_iife.js" "./expected_iife.js"
assert_identical "./dist/bundle_umd.js" "./expected_umd.js"
assert_identical "./dist/bundle_cjs.js" "./expected_cjs.js"
end
begin "$root/test_custom_config"
faucet -c assets.js
assert_identical "./dist/bundle.js" "./expected.js"
end
begin "$root/test_compact"
faucet --compact
assert_identical "./dist/bundle.js" "./expected_compacted.js"
faucet
assert_identical "./dist/bundle.js" "./expected_uncompacted.js"
end
begin "$root/test_minify"
faucet --compact
assert_identical "./dist/bundle.js" "./expected_compacted.js"
faucet
assert_identical "./dist/bundle.js" "./expected_uncompacted.js"
end
begin "$root/test_mangle"
faucet --compact
assert_identical "./dist/bundle.js" "./expected_compacted.js"
faucet
assert_identical "./dist/bundle.js" "./expected_uncompacted.js"
end
echo; echo "SUCCESS: all tests passed"