Skip to content

Commit e1774b8

Browse files
authored
Merge pull request #220 from chouchouji/chore-package
chore: optimize biome config and add dev script
2 parents 3089f30 + e57a05d commit e1774b8

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

biome.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"useIgnoreFile": true
77
},
88
"files": {
9-
"ignoreUnknown": false,
9+
"ignoreUnknown": true,
1010
"ignore": ["dist", "*.json"]
1111
},
1212
"formatter": {

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
"scripts": {
1717
"clean": "rimraf node_modules dist",
1818
"test": "pnpm build && vitest run",
19+
"dev": "tsc --watch",
1920
"build": "rimraf dist && tsc && rimraf dist/types.js",
2021
"test:watch": "vitest",
2122
"changeset:version": "changeset version",
2223
"changeset:publish": "changeset publish",
23-
"check": "biome check --write ."
24+
"check": "biome check --write --verbose"
2425
},
2526
"keywords": [
2627
"npm",

tests/cli.test.ts

+14-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import {
1515
} from 'vitest';
1616

1717
import { onHome, onTest } from '../src/actions';
18-
import { readFile, writeFile } from '../src/helpers';
1918
import { NPMRC, REGISTRIES } from '../src/constants';
19+
import { readFile, writeFile } from '../src/helpers';
2020

2121
const isWin = process.platform === 'win32';
2222

@@ -98,7 +98,11 @@ it('nrm use <registry> local', async () => {
9898

9999
expect(npmrc.registry).toBe(REGISTRIES.cnpm.registry);
100100

101-
await coffee.spawn('nrm', ['current'], { shell: isWin }).expect('stdout', /cnpm/g).expect('code', 0).end();
101+
await coffee
102+
.spawn('nrm', ['current'], { shell: isWin })
103+
.expect('stdout', /cnpm/g)
104+
.expect('code', 0)
105+
.end();
102106
});
103107

104108
it('nrm use <registry> local with user config', async () => {
@@ -115,7 +119,11 @@ it('nrm use <registry> local with user config', async () => {
115119
expect(npmrc.registry).toBe(REGISTRIES.cnpm.registry);
116120
expect(npmrc.abc).toBe('123');
117121

118-
await coffee.spawn('nrm', ['current'], { shell: isWin }).expect('stdout', /cnpm/g).expect('code', 0).end();
122+
await coffee
123+
.spawn('nrm', ['current'], { shell: isWin })
124+
.expect('stdout', /cnpm/g)
125+
.expect('code', 0)
126+
.end();
119127
});
120128

121129
it('nrm use without argument', async () => {
@@ -127,7 +135,9 @@ it('nrm use without argument', async () => {
127135
});
128136
});
129137

130-
expect(message).toBe(`? Please select the registry you want to use (Use arrow keys)
138+
expect(
139+
message,
140+
).toBe(`? Please select the registry you want to use (Use arrow keys)
131141
${isWin ? '>' : '❯'} npm
132142
yarn
133143
tencent

0 commit comments

Comments
 (0)