Skip to content

Commit

Permalink
chore: more extensive test case
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzjacobs committed Nov 11, 2020
1 parent f27f71f commit 6b36a2f
Showing 1 changed file with 46 additions and 26 deletions.
72 changes: 46 additions & 26 deletions tests/rules/natural-order.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,55 @@ import rule, { sortScripts } from "../../src/rules/natural-order";

describe("natural-order.ts", () => {
const scriptsUnsorted = {
postbuild: "foo",
"test:lint": "baz",
"build:cleanup": "bar",
"update:typings": "something",
test: "jest",
posttest: "baz",
pretest: "baz",
update: "foo",
"update:dependencies": "updtr",
prebuild: "foo",
build: "foo",
publish: "ok",
prepublishOnly: "else",
postbuild: "echo 1",
build: "echo 1",
"test:lint": "echo 1",
"test:lint:scripts:es7": "echo 1",
dev: "echo 1",
posttest: "echo 1",
"other:update:dependencies": "echo 1",
preinstall: "echo 1",
prebuild: "echo 1",
"other:update": "echo 1",
"other:update:typings": "echo 1",
"test:lint:scripts": "echo 1",
"test:lint:scripts:babel": "echo 1",
"test:lint:styles:scss": "echo 1",
publish: "echo 1",
prepublishOnly: "echo 1",
"build:cleanup": "echo 1",
"test:lint:styles": "echo 1",
test: "echo 1",
start: "echo 1",
pretest: "echo 1",
"pretest:lint:scripts:es7": "echo 1",
"test:lint:styles:postcss": "echo 1",
};

const scriptsSorted = {
prebuild: "foo",
build: "foo",
"build:cleanup": "bar",
postbuild: "foo",
publish: "ok",
prepublishOnly: "else",
pretest: "baz",
test: "jest",
"test:lint": "baz",
posttest: "baz",
update: "foo",
"update:dependencies": "updtr",
"update:typings": "something",
prebuild: "echo 1",
build: "echo 1",
"build:cleanup": "echo 1",
postbuild: "echo 1",
dev: "echo 1",
preinstall: "echo 1",
"other:update": "echo 1",
"other:update:dependencies": "echo 1",
"other:update:typings": "echo 1",
publish: "echo 1",
prepublishOnly: "echo 1",
start: "echo 1",
pretest: "echo 1",
"pretest:lint:scripts:es7": "echo 1",
test: "echo 1",
"test:lint": "echo 1",
"test:lint:scripts": "echo 1",
"test:lint:scripts:babel": "echo 1",
"test:lint:scripts:es7": "echo 1",
"test:lint:styles": "echo 1",
"test:lint:styles:postcss": "echo 1",
"test:lint:styles:scss": "echo 1",
posttest: "echo 1",
};

describe("validate()", () => {
Expand Down

0 comments on commit 6b36a2f

Please sign in to comment.