mirror of
https://github.com/nfonteyne/octane-website.git
synced 2026-09-03 23:24:48 +02:00
update: unit test, push packages with ci/cd
This commit is contained in:
parent
e97aa2c6c3
commit
0300f7fef0
6 changed files with 165 additions and 5 deletions
16
test/spotify.test.js
Normal file
16
test/spotify.test.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
const { test } = require('node:test');
|
||||
const assert = require('node:assert/strict');
|
||||
const { isValidSpotifyUrl } = require('../src/lib/spotify');
|
||||
|
||||
test('isValidSpotifyUrl: true for open.spotify.com links', () => {
|
||||
assert.equal(isValidSpotifyUrl('https://open.spotify.com/track/4uLU6hMCjMI75M1A2tKUQC'), true);
|
||||
});
|
||||
|
||||
test('isValidSpotifyUrl: false for other hosts', () => {
|
||||
assert.equal(isValidSpotifyUrl('https://www.youtube.com/watch?v=abc'), false);
|
||||
assert.equal(isValidSpotifyUrl('https://spotify.com/track/abc'), false);
|
||||
});
|
||||
|
||||
test('isValidSpotifyUrl: false for malformed URL', () => {
|
||||
assert.equal(isValidSpotifyUrl('not a url'), false);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue