Skip to content

Commit

Permalink
build: rm redundant peerDep range test
Browse files Browse the repository at this point in the history
Co-authored-by: Rostislav Simonik <rostislav.simonik@technologystudio.sk>
  • Loading branch information
mightyiam and rostislav-simonik committed Jul 15, 2023
1 parent 5318d4d commit 4e7ac4f
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,17 +303,14 @@ test('Dependencies range types', async (t) => {
t.deepEqual(Object.keys(ourDeps).sort(), ['@typescript-eslint/parser', 'eslint-config-standard'])
t.true(isPinnedRange(ourDeps['eslint-config-standard']), 'eslint-config-standard is pinned')
t.true(isSingleCaretRange(ourDeps['@typescript-eslint/parser']), '@typescript-eslint/parser is a single `^` range.')

for (const [name, range] of Object.entries(ourPeerDeps as Record<string, string>)) {
if (name === 'typescript') {
t.is(range, '*', 'Peer dependency typescript is `*`')
} else {
t.true(
isSingleCaretRange(range),
`Peer dependency \`${name}: ${range}\` is a single \`^\` range.`
)
}
}
const typescriptValue = ourPeerDeps.typescript
t.is(typescriptValue, '*', 'Peer dependency typescript is `*`')
const typescriptEslintPluginValue = ourPeerDeps['@typescript-eslint/eslint-plugin']
if (typescriptEslintPluginValue === undefined) throw new Error()
t.true(
isSingleCaretRange(typescriptEslintPluginValue),
`Peer dependency \`@typescript-eslint/eslint-plugin: ${typescriptEslintPluginValue}\` is a single \`^\` range.`
)
for (const [name, spec] of Object.entries(ourDevDeps)) {
const range = name.startsWith(`${typescriptEslintBottom}/`) ? extractVersionSpec(spec) : spec
t.true(isPinnedRange(range), `Dev dependency \`${name}: ${spec}\` is pinned`)
Expand Down

0 comments on commit 4e7ac4f

Please sign in to comment.