Skip to content

Commit 0281c53

Browse files
committed
Lint nits
1 parent 80dbf03 commit 0281c53

5 files changed

Lines changed: 77 additions & 24 deletions

File tree

src/commands/npm/cmd-npm-malware.test.mts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { describe, expect, it } from 'vitest'
22

3-
import constants, { FLAG_CONFIG, FLAG_DRY_RUN } from '../../../src/constants.mts'
3+
import constants, {
4+
FLAG_CONFIG,
5+
FLAG_DRY_RUN,
6+
} from '../../../src/constants.mts'
47
import { cmdit, spawnSocketCli } from '../../../test/utils.mts'
58

69
describe('socket npm - malware detection with mocked packages', () => {
@@ -54,7 +57,10 @@ describe('socket npm - malware detection with mocked packages', () => {
5457
async cmd => {
5558
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
5659
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
57-
expect(code, 'dry-run exec with multiple issueRules should exit with code 0').toBe(0)
60+
expect(
61+
code,
62+
'dry-run exec with multiple issueRules should exit with code 0',
63+
).toBe(0)
5864
},
5965
)
6066

@@ -71,7 +77,9 @@ describe('socket npm - malware detection with mocked packages', () => {
7177
async cmd => {
7278
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
7379
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
74-
expect(code, 'dry-run exec with --config should exit with code 0').toBe(0)
80+
expect(code, 'dry-run exec with --config should exit with code 0').toBe(
81+
0,
82+
)
7583
},
7684
)
7785
})
@@ -124,8 +132,11 @@ describe('socket npm - malware detection with mocked packages', () => {
124132
async cmd => {
125133
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
126134
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
127-
expect(code, 'dry-run install with --config should exit with code 0').toBe(0)
135+
expect(
136+
code,
137+
'dry-run install with --config should exit with code 0',
138+
).toBe(0)
128139
},
129140
)
130141
})
131-
})
142+
})

src/commands/npx/cmd-npx-malware.test.mts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { describe, expect, it } from 'vitest'
22

3-
import constants, { FLAG_CONFIG, FLAG_DRY_RUN } from '../../../src/constants.mts'
3+
import constants, {
4+
FLAG_CONFIG,
5+
FLAG_DRY_RUN,
6+
} from '../../../src/constants.mts'
47
import { cmdit, spawnSocketCli } from '../../../test/utils.mts'
58

69
describe('socket npx - malware detection with mocked packages', () => {
@@ -51,7 +54,10 @@ describe('socket npx - malware detection with mocked packages', () => {
5154
async cmd => {
5255
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
5356
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
54-
expect(code, 'dry-run npx with multiple issueRules should exit with code 0').toBe(0)
57+
expect(
58+
code,
59+
'dry-run npx with multiple issueRules should exit with code 0',
60+
).toBe(0)
5561
},
5662
)
5763

@@ -67,8 +73,10 @@ describe('socket npx - malware detection with mocked packages', () => {
6773
async cmd => {
6874
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
6975
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
70-
expect(code, 'dry-run npx with --config should exit with code 0').toBe(0)
76+
expect(code, 'dry-run npx with --config should exit with code 0').toBe(
77+
0,
78+
)
7179
},
7280
)
7381
})
74-
})
82+
})

src/commands/pnpm/cmd-pnpm-malware.test.mts

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { describe, expect, it } from 'vitest'
22

3-
import constants, { FLAG_CONFIG, FLAG_DRY_RUN } from '../../../src/constants.mts'
3+
import constants, {
4+
FLAG_CONFIG,
5+
FLAG_DRY_RUN,
6+
} from '../../../src/constants.mts'
47
import { cmdit, spawnSocketCli } from '../../../test/utils.mts'
58

69
describe('socket pnpm - malware detection with mocked packages', () => {
@@ -20,7 +23,9 @@ describe('socket pnpm - malware detection with mocked packages', () => {
2023
async cmd => {
2124
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
2225
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
23-
expect(code, 'dry-run pnpm exec with -c should exit with code 0').toBe(0)
26+
expect(code, 'dry-run pnpm exec with -c should exit with code 0').toBe(
27+
0,
28+
)
2429
},
2530
)
2631

@@ -37,7 +42,9 @@ describe('socket pnpm - malware detection with mocked packages', () => {
3742
async cmd => {
3843
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
3944
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
40-
expect(code, 'dry-run pnpm exec with -c should exit with code 0').toBe(0)
45+
expect(code, 'dry-run pnpm exec with -c should exit with code 0').toBe(
46+
0,
47+
)
4148
},
4249
)
4350

@@ -54,7 +61,10 @@ describe('socket pnpm - malware detection with mocked packages', () => {
5461
async cmd => {
5562
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
5663
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
57-
expect(code, 'dry-run pnpm exec with multiple issueRules should exit with code 0').toBe(0)
64+
expect(
65+
code,
66+
'dry-run pnpm exec with multiple issueRules should exit with code 0',
67+
).toBe(0)
5868
},
5969
)
6070

@@ -71,7 +81,10 @@ describe('socket pnpm - malware detection with mocked packages', () => {
7181
async cmd => {
7282
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
7383
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
74-
expect(code, 'dry-run pnpm exec with --config should exit with code 0').toBe(0)
84+
expect(
85+
code,
86+
'dry-run pnpm exec with --config should exit with code 0',
87+
).toBe(0)
7588
},
7689
)
7790
})
@@ -90,7 +103,10 @@ describe('socket pnpm - malware detection with mocked packages', () => {
90103
async cmd => {
91104
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
92105
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
93-
expect(code, 'dry-run pnpm install with -c should exit with code 0').toBe(0)
106+
expect(
107+
code,
108+
'dry-run pnpm install with -c should exit with code 0',
109+
).toBe(0)
94110
},
95111
)
96112

@@ -124,8 +140,11 @@ describe('socket pnpm - malware detection with mocked packages', () => {
124140
async cmd => {
125141
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
126142
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
127-
expect(code, 'dry-run pnpm install with --config should exit with code 0').toBe(0)
143+
expect(
144+
code,
145+
'dry-run pnpm install with --config should exit with code 0',
146+
).toBe(0)
128147
},
129148
)
130149
})
131-
})
150+
})

src/commands/yarn/cmd-yarn-malware.test.mts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { describe, expect, it } from 'vitest'
22

3-
import constants, { FLAG_CONFIG, FLAG_DRY_RUN } from '../../../src/constants.mts'
3+
import constants, {
4+
FLAG_CONFIG,
5+
FLAG_DRY_RUN,
6+
} from '../../../src/constants.mts'
47
import { cmdit, spawnSocketCli } from '../../../test/utils.mts'
58

69
describe('socket yarn - malware detection with mocked packages', () => {
@@ -54,7 +57,10 @@ describe('socket yarn - malware detection with mocked packages', () => {
5457
async cmd => {
5558
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
5659
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
57-
expect(code, 'dry-run yarn dlx with multiple issueRules should exit with code 0').toBe(0)
60+
expect(
61+
code,
62+
'dry-run yarn dlx with multiple issueRules should exit with code 0',
63+
).toBe(0)
5864
},
5965
)
6066

@@ -71,7 +77,10 @@ describe('socket yarn - malware detection with mocked packages', () => {
7177
async cmd => {
7278
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
7379
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
74-
expect(code, 'dry-run yarn dlx with --config should exit with code 0').toBe(0)
80+
expect(
81+
code,
82+
'dry-run yarn dlx with --config should exit with code 0',
83+
).toBe(0)
7584
},
7685
)
7786
})
@@ -107,7 +116,10 @@ describe('socket yarn - malware detection with mocked packages', () => {
107116
async cmd => {
108117
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
109118
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
110-
expect(code, 'dry-run yarn add with --config should exit with code 0').toBe(0)
119+
expect(
120+
code,
121+
'dry-run yarn add with --config should exit with code 0',
122+
).toBe(0)
111123
},
112124
)
113125

@@ -123,8 +135,11 @@ describe('socket yarn - malware detection with mocked packages', () => {
123135
async cmd => {
124136
const { code, stdout } = await spawnSocketCli(binCliPath, cmd)
125137
expect(stdout).toMatchInlineSnapshot('"[DryRun]: Bailing now"')
126-
expect(code, 'dry-run yarn install with -c should exit with code 0').toBe(0)
138+
expect(
139+
code,
140+
'dry-run yarn install with -c should exit with code 0',
141+
).toBe(0)
127142
},
128143
)
129144
})
130-
})
145+
})

test/mock-malware-api.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ describe('mock-malware-api utilities', () => {
7171
expect(response.score?.license).toBe(1)
7272
})
7373
})
74-
})
74+
})

0 commit comments

Comments
 (0)