From 6b36a2fdff7daeed922d0d88cdece5a654a5174c Mon Sep 17 00:00:00 2001 From: Moritz Jacobs Date: Wed, 11 Nov 2020 08:48:36 +0100 Subject: [PATCH] chore: more extensive test case --- tests/rules/natural-order.test.ts | 72 ++++++++++++++++++++----------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/tests/rules/natural-order.test.ts b/tests/rules/natural-order.test.ts index 4cb1d18..e81fbf6 100644 --- a/tests/rules/natural-order.test.ts +++ b/tests/rules/natural-order.test.ts @@ -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()", () => {