Skip to content

Commit 6898674

Browse files
committed
test: add production tests
1 parent 044bfd4 commit 6898674

4 files changed

Lines changed: 224 additions & 1 deletion

File tree

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@
2020
"test.format": "prettier . --check",
2121
"lint": "eslint . --fix",
2222
"test.lint": "eslint .",
23-
"bump": "ncu -u"
23+
"bump": "ncu -u",
24+
"test": "atom --test ./test/"
2425
},
26+
"atomTestRunner": "./test/runner",
2527
"devDependencies": {
28+
"atom-jasmine3-test-runner": "^5.2.6",
2629
"eslint": "^7.29.0",
2730
"eslint-config-atomic": "^1.16.1",
2831
"prettier-config-atomic": "^2.0.5"

pnpm-lock.yaml

Lines changed: 195 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/index-spec.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
describe("Terser-Config-Atomic", () => {
2+
it("production", () => {
3+
process.env.NODE_ENV = "production"
4+
5+
const TerserOptions = require("../src/.terserrc")
6+
7+
expect(typeof TerserOptions).toBe("object")
8+
expect(TerserOptions.compress.global_defs).toEqual({
9+
"@atom.inSpecMode": "() => false",
10+
"@atom.inDevMode": "() => false",
11+
})
12+
expect(TerserOptions.compress.passes).toBe(3)
13+
expect(TerserOptions.mangle).toBeTrue()
14+
expect(TerserOptions.format.beautify).toBeFalse()
15+
})
16+
})

test/runner.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"use babel"
2+
import { createRunner } from "atom-jasmine3-test-runner"
3+
4+
// https://github.com/UziTech/atom-jasmine3-test-runner#api
5+
export default createRunner({
6+
timeReporter: true,
7+
specHelper: true,
8+
silentInstallation: true,
9+
})

0 commit comments

Comments
 (0)