Skip to content

Commit d780bff

Browse files
committed
refactor: test/base.test.js -> test.js
1 parent 04f2454 commit d780bff

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"types": "./index.d.ts",
1313
"scripts": {
1414
"test": "npm run -s test:code && npm run -s test:typescript && npm run -s test:coverage",
15-
"test:code": "c8 uvu test",
15+
"test:code": "c8 node test.js",
1616
"test:coverage": "c8 check-coverage",
1717
"test:typescript": "tsd"
1818
},

test/base.test.js renamed to test.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { test } from "uvu";
22
import * as assert from "uvu/assert";
33

4-
import { Base } from "../index.js";
5-
import { fooPlugin } from "../plugins/foo/index.js";
6-
import { barPlugin } from "../plugins/bar/index.js";
7-
import { voidPlugin } from "../plugins/void/index.js";
4+
import { Base } from "./index.js";
5+
import { fooPlugin } from "./plugins/foo/index.js";
6+
import { barPlugin } from "./plugins/bar/index.js";
7+
import { voidPlugin } from "./plugins/void/index.js";
88

99
test(".plugin(fooPlugin)", () => {
1010
const FooTest = Base.plugin(fooPlugin);
@@ -46,12 +46,18 @@ test(".defaults({one: 1}).defaults({two: 2})", () => {
4646
});
4747

4848
test(".defaults({foo: 'bar', baz: 'daz' })", () => {
49-
const BaseWithDefaults = Base.defaults({ foo: "bar" }).defaults({ baz: "daz" });
49+
const BaseWithDefaults = Base.defaults({ foo: "bar" }).defaults({
50+
baz: "daz",
51+
});
5052
const defaultsTest = new BaseWithDefaults();
5153
const mergedOptionsTest = new BaseWithDefaults({ faz: "boo" });
5254
assert.equal(BaseWithDefaults.defaultOptions, { foo: "bar", baz: "daz" });
5355
assert.equal(defaultsTest.options, { foo: "bar", baz: "daz" });
54-
assert.equal(mergedOptionsTest.options, { foo: "bar", baz: "daz", faz: "boo" });
56+
assert.equal(mergedOptionsTest.options, {
57+
foo: "bar",
58+
baz: "daz",
59+
faz: "boo",
60+
});
5561
});
5662

5763
test(".plugin().defaults()", () => {

0 commit comments

Comments
 (0)