Compare commits

..

9 commits

Author SHA1 Message Date
6615755b11 Update dependency postcss to v8.5.5
All checks were successful
ci / build-image (pull_request) Successful in 3m13s
ci / test-image (pull_request) Successful in 6s
ci / build-image (push) Successful in 7s
ci / test-image (push) Successful in 11s
2025-06-13 00:07:59 +00:00
1adc27e6dc Update dependency koa-compress to ~5.1.0
All checks were successful
ci / build-image (push) Successful in 2m37s
ci / test-image (push) Successful in 7s
2025-06-12 22:17:27 +00:00
6b374d3813 Update dependency mocha to v8.4.0
All checks were successful
ci / build-image (pull_request) Successful in 4m17s
ci / test-image (pull_request) Successful in 7s
ci / build-image (push) Successful in 5s
ci / test-image (push) Successful in 6s
2025-06-12 22:05:07 +00:00
1ed817284b Update dependency eslint-config-airbnb-base to v14.2.1
All checks were successful
ci / build-image (pull_request) Successful in 3m43s
ci / test-image (pull_request) Successful in 9s
ci / build-image (push) Successful in 5s
ci / test-image (push) Successful in 6s
2025-06-12 21:12:38 +00:00
b395b85067 Update dependency koa-bodyparser to v4.4.1
All checks were successful
ci / build-image (pull_request) Successful in 2m33s
ci / test-image (pull_request) Successful in 7s
ci / build-image (push) Successful in 5s
ci / test-image (push) Successful in 6s
2025-06-12 20:54:43 +00:00
0984359a77 Actually require the image to be built for tests
All checks were successful
ci / build-image (push) Successful in 5s
ci / test-image (push) Successful in 8s
2025-06-12 21:54:17 +01:00
90bce4c345 Update dependency @sentry/node to v5.30.0
All checks were successful
ci / build-image (pull_request) Successful in 2m32s
ci / test-image (pull_request) Successful in 12s
ci / build-image (push) Successful in 5s
ci / test-image (push) Successful in 7s
2025-06-12 20:40:28 +00:00
fcdff4031c Update dependency @babel/cli to v7.27.2
All checks were successful
ci / build-image (pull_request) Successful in 1m0s
ci / test-image (pull_request) Successful in 7s
ci / build-image (push) Successful in 5s
ci / test-image (push) Successful in 7s
2025-06-12 20:26:24 +00:00
4dfd6e93b2 Add tests to action
All checks were successful
ci / build-image (push) Successful in 59s
ci / test-image (push) Successful in 8s
2025-06-12 21:21:33 +01:00
6 changed files with 1327 additions and 434 deletions

View file

@ -41,6 +41,7 @@ jobs:
tags: latest ${{ github.sha }} tags: latest ${{ github.sha }}
test-image: test-image:
runs-on: self-hosted runs-on: self-hosted
needs: build-image
steps: steps:
- name: Check out repository - name: Check out repository
uses: https://cremin.dev/actions/checkout@v4 uses: https://cremin.dev/actions/checkout@v4

View file

@ -4,7 +4,7 @@ services:
app: app:
build: build:
context: ./ context: ./
dockerfile: Dockerfile.dev dockerfile: Containerfile
environment: environment:
DEBUG: "combine.fm*" DEBUG: "combine.fm*"
VUE_ENV: server VUE_ENV: server
@ -30,7 +30,7 @@ services:
worker: worker:
build: build:
context: ./ context: ./
dockerfile: Dockerfile.dev dockerfile: Containerfile
environment: environment:
DEBUG: "combine.fm*" DEBUG: "combine.fm*"
VUE_ENV: server VUE_ENV: server

View file

@ -38,7 +38,7 @@
"kcors": "^2.2.1", "kcors": "^2.2.1",
"koa": "^2.13.0", "koa": "^2.13.0",
"koa-bodyparser": "^4.3.0", "koa-bodyparser": "^4.3.0",
"koa-compress": "~5.0.1", "koa-compress": "~5.1.0",
"koa-favicon": "~2.1.0", "koa-favicon": "~2.1.0",
"koa-logger": "~3.2.1", "koa-logger": "~3.2.1",
"koa-route": "~3.2.0", "koa-route": "~3.2.0",
@ -79,6 +79,6 @@
"should": "^13.2.1" "should": "^13.2.1"
}, },
"resolutions": { "resolutions": {
"postcss": "8.3.11" "postcss": "8.5.5"
} }
} }

View file

@ -1,9 +1,11 @@
import 'should'; import "should";
import lookup from '../lib/lookup.js'; import lookup from "../lib/lookup.js";
describe('Search with url', function(){ describe("Search with url", function() {
it('should find album by url', async function (){ it("should find album by url", async function() {
const result = await lookup('https://play.google.com/music/m/Bw2bwajaddrgr5vakp3vluqothq'); const result = await lookup(
result.name.should.equal('Breaking'); "https://open.spotify.com/album/5TbRo1rBrhgHSTB4i2wdZS"
);
result.name.should.equal("Atom Bomb");
}); });
}); });

View file

@ -0,0 +1,46 @@
import 'should';
import * as spotify from '../../lib/services/spotify/index.js';
describe('Spotify', function(){
describe('init', function(){
it('should have secrets', async function (){
process.env.SPOTIFY_CLIENT_ID.should.exist();
});
});
describe('lookupId', function(){
it('should find album by ID', async function (){
const result = await spotify.lookupId('77UW17CZFyCaRLHdHeofZu', 'album');
result.name.should.equal('Listen');
});
it('should find track by ID', async function (){
const result = await spotify.lookupId('7dS5EaCoMnN7DzlpT6aRn2', 'track');
result.name.should.equal('Take Me To Church');
});
});
describe('search', function(){
it('should find album by search', async function (){
const result = await spotify.search({type: 'album', artist: {name: 'David Guetta'}, name: 'Listen (Deluxe)'});
result.name.should.equal('Listen (Deluxe)');
});
it('should find br album by search', async function (){
const result = await spotify.search({type: 'album', artist: {name: 'Anavitória'}, name: 'Fica'});
result.name.should.equal('Fica');
});
it('should find album by various artists by search', async function (){
const result = await spotify.search({type: 'album', artist: {name: 'Various Artists'}, name: 'The Get Down Part II: Original Soundtrack From The Netflix Original Series'});
result.name.should.equal('The Get Down Part II: Original Soundtrack From The Netflix Original Series');
});
});
describe('parseUrl', function(){
it('should parse url into ID', async function (){
const result = await spotify.parseUrl('https://play.spotify.com/album/77UW17CZFyCaRLHdHeofZu');
result.id.should.equal('77UW17CZFyCaRLHdHeofZu');
});
});
});

1692
yarn.lock

File diff suppressed because it is too large Load diff