Skip to content

Commit df52c01

Browse files
committed
test: add development tests
1 parent 6898674 commit df52c01

4 files changed

Lines changed: 25 additions & 15 deletions

File tree

.github/workflows/CI.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ on:
33
- push
44
- pull_request
55

6-
defaults:
7-
run:
8-
shell: bash
9-
106
jobs:
117
Test:
128
if: "!contains(github.event.head_commit.message, '[skip ci]')"
@@ -25,8 +21,6 @@ jobs:
2521
- uses: UziTech/action-setup-atom@v1
2622
with:
2723
channel: ${{ matrix.atom_channel }}
28-
- name: Versions
29-
run: apm -v
3024
- name: Install APM dependencies
3125
run: |
3226
apm install
@@ -74,10 +68,3 @@ jobs:
7468
env:
7569
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7670
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
77-
78-
Skip:
79-
if: contains(github.event.head_commit.message, '[skip ci]')
80-
runs-on: ubuntu-latest
81-
steps:
82-
- name: Skip CI 🚫
83-
run: echo skip ci

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"atom-jasmine3-test-runner": "^5.2.6",
2929
"eslint": "^7.29.0",
3030
"eslint-config-atomic": "^1.16.1",
31-
"prettier-config-atomic": "^2.0.5"
31+
"prettier-config-atomic": "^2.0.5",
32+
"requirefresh": "^5.1.0"
3233
}
3334
}

pnpm-lock.yaml

Lines changed: 7 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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
const { requireFresh } = require("requirefresh")
2+
const path = require("path")
3+
4+
const terserFile = path.join(path.dirname(__dirname), "src", ".terserrc.js")
5+
16
describe("Terser-Config-Atomic", () => {
27
it("production", () => {
38
process.env.NODE_ENV = "production"
49

5-
const TerserOptions = require("../src/.terserrc")
10+
const TerserOptions = requireFresh(terserFile)
611

712
expect(typeof TerserOptions).toBe("object")
813
expect(TerserOptions.compress.global_defs).toEqual({
@@ -13,4 +18,14 @@ describe("Terser-Config-Atomic", () => {
1318
expect(TerserOptions.mangle).toBeTrue()
1419
expect(TerserOptions.format.beautify).toBeFalse()
1520
})
21+
it("development", () => {
22+
process.env.NODE_ENV = "development"
23+
24+
const TerserOptions = requireFresh(terserFile)
25+
26+
expect(typeof TerserOptions).toBe("object")
27+
expect(TerserOptions.compress).toBeFalse()
28+
expect(TerserOptions.mangle).toBeFalse()
29+
expect(TerserOptions.format.beautify).toBeTrue()
30+
})
1631
})

0 commit comments

Comments
 (0)