Skip to content

Commit

Permalink
fix: colorized-brackets tests fail to find fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMakesGames committed Nov 8, 2024
1 parent a969a6e commit c7dcf3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/colorized-brackets/test/fixtures.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import {
* In the final line, there's not room underneath the `}` to annotate the color, so an explicit index `0=Y` is used after `@colors`.
*/
describe('file-driven tests', async () => {
const testCaseFiles: [string][] = readdirSync('./test/fixtures', {
const testCaseFiles: [string][] = readdirSync(join(import.meta.dirname, 'fixtures'), {
recursive: true,
})
.filter(
(fileName): fileName is string =>
typeof fileName === 'string'
&& lstatSync(join('./test/fixtures', fileName)).isFile(),
&& lstatSync(join(import.meta.dirname, 'fixtures', fileName)).isFile(),
)
.map<[string]>(fileName => [fileName])
const langs = Array.from(
Expand All @@ -48,7 +48,7 @@ describe('file-driven tests', async () => {
})

it.each(testCaseFiles)('%s', async (fileName) => {
const path = join('./test/fixtures', fileName)
const path = join(import.meta.dirname, 'fixtures', fileName)
const lang = fileName.split('/').at(0) ?? 'text'
const content = await readFile(path, { encoding: 'utf-8' })
const expectedBrackets = parseExpectedBrackets(content)
Expand Down

0 comments on commit c7dcf3f

Please sign in to comment.