Skip to content

Commit

Permalink
Start fixing tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
illright committed Jun 16, 2024
1 parent 1a36191 commit 2414bcf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/steiger-plugin-fsd/src/_lib/prepare-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export function compareMessages(a: Diagnostic, b: Diagnostic): number {
return a.message.localeCompare(b.message)
}

export function joinFromRoot(...segments: Array<string>) {
return join('/', ...segments)
}

if (import.meta.vitest) {
const { test, expect } = import.meta.vitest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, it } from 'vitest'

import { compareMessages, parseIntoFsdRoot } from '../_lib/prepare-test.js'
import { compareMessages, parseIntoFsdRoot, joinFromRoot } from '../_lib/prepare-test.js'
import inconsistentNaming from './index.js'

it('reports no errors on slice names that are pluralized consistently', () => {
Expand Down Expand Up @@ -35,7 +35,7 @@ it('reports an error on slice names that are not pluralized consistently', () =>
fixes: [
{
type: 'rename',
path: '/entities/user',
path: joinFromRoot('entities', 'user'),
newName: 'users',
},
],
Expand Down Expand Up @@ -64,7 +64,7 @@ it('prefers the singular form when there are more singular slices', () => {
fixes: [
{
type: 'rename',
path: '/entities/comments',
path: joinFromRoot('entities', 'comments'),
newName: 'comment',
},
],
Expand Down

0 comments on commit 2414bcf

Please sign in to comment.