Skip to content

Commit b411c56

Browse files
committed
test: updated tests to cover JSR case sensitivity criteria.
1 parent 51a9ce5 commit b411c56

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

test/jsr.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,22 @@ t.test('JSR Result object passthrough', t => {
171171
t.end()
172172
})
173173

174-
t.test('JSR case insensitivity', t => {
175-
const res1 = npa('jsr:@std/testing')
176-
const res2 = npa('JSR:@std/testing')
177-
const res3 = npa('JsR:@std/testing')
178-
179-
t.equal(res1.name, '@jsr/std__testing', 'lowercase jsr: works')
180-
t.equal(res2.name, '@jsr/std__testing', 'uppercase JSR: works')
181-
t.equal(res3.name, '@jsr/std__testing', 'mixed case JsR: works')
174+
t.test('JSR case sensitivity', t => {
175+
const res = npa('jsr:@std/testing')
176+
177+
t.equal(res.name, '@jsr/std__testing', 'lowercase jsr: works')
178+
179+
t.throws(
180+
() => npa('JSR:@std/testing'),
181+
/Unsupported URL Type/,
182+
'throws error when package is parsed as unsupported URL type'
183+
)
184+
185+
t.throws(
186+
() => npa('JsR:@std/testing'),
187+
/Unsupported URL Type/,
188+
'throws error when package is parsed as unsupported URL type'
189+
)
190+
182191
t.end()
183192
})

0 commit comments

Comments
 (0)