feat(front): lint test directory
This commit is contained in:
parent
a8b7e07a86
commit
719c3171f8
|
@ -11,7 +11,7 @@
|
||||||
"serve": "vite preview",
|
"serve": "vite preview",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:unit": "vitest run",
|
"test:unit": "vitest run",
|
||||||
"lint": "eslint --ext .ts,.js,.vue,.json,.html src public/embed.html",
|
"lint": "eslint --ext .ts,.js,.vue,.json,.html src test public/embed.html",
|
||||||
"lint:tsc": "vue-tsc --noEmit",
|
"lint:tsc": "vue-tsc --noEmit",
|
||||||
"fix-fomantic-css": "scripts/fix-fomantic-css.sh",
|
"fix-fomantic-css": "scripts/fix-fomantic-css.sh",
|
||||||
"postinstall": "yarn run fix-fomantic-css"
|
"postinstall": "yarn run fix-fomantic-css"
|
||||||
|
|
|
@ -136,7 +136,7 @@ export const useQueue = createGlobalState(() => {
|
||||||
async function enqueueAt(index: number, ...newTracks: Track[]): Promise<void>
|
async function enqueueAt(index: number, ...newTracks: Track[]): Promise<void>
|
||||||
// NOTE: Only last boolean of newTracks is considered as skipFetch
|
// NOTE: Only last boolean of newTracks is considered as skipFetch
|
||||||
async function enqueueAt(index: number, ...newTracks: (Track | boolean)[]): Promise<void>
|
async function enqueueAt(index: number, ...newTracks: (Track | boolean)[]): Promise<void>
|
||||||
async function enqueueAt(index: number, ...newTracks: (Track | boolean)[]): Promise<void> {
|
async function enqueueAt (index: number, ...newTracks: (Track | boolean)[]): Promise<void> {
|
||||||
let skipFetch = false
|
let skipFetch = false
|
||||||
if (!isTrack(newTracks[newTracks.length - 1])) {
|
if (!isTrack(newTracks[newTracks.length - 1])) {
|
||||||
skipFetch = newTracks.pop() as boolean
|
skipFetch = newTracks.pop() as boolean
|
||||||
|
@ -164,7 +164,7 @@ export const useQueue = createGlobalState(() => {
|
||||||
async function enqueue(...newTracks: Track[]): Promise<void>
|
async function enqueue(...newTracks: Track[]): Promise<void>
|
||||||
// NOTE: Only last boolean of newTracks is considered as skipFetch
|
// NOTE: Only last boolean of newTracks is considered as skipFetch
|
||||||
async function enqueue(...newTracks: (Track | boolean)[]): Promise<void>
|
async function enqueue(...newTracks: (Track | boolean)[]): Promise<void>
|
||||||
async function enqueue(...newTracks: (Track | boolean)[]): Promise<void> {
|
async function enqueue (...newTracks: (Track | boolean)[]): Promise<void> {
|
||||||
return enqueueAt(tracks.value.length, ...newTracks)
|
return enqueueAt(tracks.value.length, ...newTracks)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,4 +4,3 @@ import { vi } from 'vitest'
|
||||||
vi.mock('standardized-audio-context', () => ({
|
vi.mock('standardized-audio-context', () => ({
|
||||||
AudioContext
|
AudioContext
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { useQueue } from '~/composables/audio/queue'
|
import { useQueue } from '~/composables/audio/queue'
|
||||||
import type { Track } from '~/types'
|
import type { Track } from '~/types'
|
||||||
|
|
||||||
const { tracks, enqueue, dequeue, clear, reorder, currentIndex, shuffle } = useQueue()
|
const { tracks, enqueue, dequeue, clear, reorder, currentIndex } = useQueue()
|
||||||
|
|
||||||
describe('currentIndex', () => {
|
describe('currentIndex', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
|
@ -9,7 +9,7 @@ describe('currentIndex', () => {
|
||||||
await enqueue(
|
await enqueue(
|
||||||
{ id: 1, uploads: [] } as any as Track,
|
{ id: 1, uploads: [] } as any as Track,
|
||||||
{ id: 2, uploads: [] } as any as Track,
|
{ id: 2, uploads: [] } as any as Track,
|
||||||
{ id: 3, uploads: [] } as any as Track,
|
{ id: 3, uploads: [] } as any as Track
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ describe('Ordered queue', () => {
|
||||||
await enqueue(
|
await enqueue(
|
||||||
{ id: 1, uploads: [] } as any as Track,
|
{ id: 1, uploads: [] } as any as Track,
|
||||||
{ id: 2, uploads: [] } as any as Track,
|
{ id: 2, uploads: [] } as any as Track,
|
||||||
{ id: 3, uploads: [] } as any as Track,
|
{ id: 3, uploads: [] } as any as Track
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue