1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2025-05-18 12:02:53 +02:00

perf: run tests in parallel

fixes #12
This commit is contained in:
Divlo
2022-09-22 16:16:21 +02:00
parent d6a6c706ce
commit 64d71d6920
18 changed files with 781 additions and 704 deletions

View File

@ -1,15 +1,29 @@
import crypto from 'node:crypto'
import tap from 'tap'
import sinon from 'sinon'
import { Challenge } from '../Challenge.js'
import { GitAffected } from '../GitAffected.js'
import { Solution } from '../Solution.js'
import { parseCommandOutput } from '../../utils/parseCommandOutput.js'
const gitAffected = new GitAffected({ isContinuousIntegration: false })
const gitAffected = new GitAffected()
await tap.test('services/GitAffected', async (t) => {
await t.test('parseGitOutput', async (t) => {
t.afterEach(() => {
sinon.restore()
})
t.beforeEach(() => {
sinon.stub(crypto, 'randomUUID').value(() => {
return 'uuid'
})
})
await t.test('parseCommandOutput', async (t) => {
await t.test('returns the right output array', async (t) => {
t.same(gitAffected.parseGitOutput('1.txt\n 2.txt '), ['1.txt', '2.txt'])
t.same(parseCommandOutput('1.txt\n 2.txt '), ['1.txt', '2.txt'])
})
})