2023-04-07 16:02:47 +00:00
|
|
|
import { describe, expect, it } from 'vitest'
|
2023-01-20 16:23:16 +00:00
|
|
|
import { resolveGroupSyntax } from './ignore.js'
|
|
|
|
|
|
|
|
describe('resolveGroupSyntax', () => {
|
|
|
|
it('should resolve single group syntax', () => {
|
|
|
|
expect(resolveGroupSyntax('**/*.{spec}.{js,ts}')).toStrictEqual([
|
|
|
|
'**/*.spec.js',
|
2024-04-05 18:08:32 +00:00
|
|
|
'**/*.spec.ts',
|
2023-01-20 16:23:16 +00:00
|
|
|
])
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should resolve multi-group syntax', () => {
|
|
|
|
expect(resolveGroupSyntax('**/*.{spec,test}.{js,ts}')).toStrictEqual([
|
|
|
|
'**/*.spec.js',
|
|
|
|
'**/*.spec.ts',
|
|
|
|
'**/*.test.js',
|
2024-04-05 18:08:32 +00:00
|
|
|
'**/*.test.ts',
|
2023-01-20 16:23:16 +00:00
|
|
|
])
|
|
|
|
})
|
|
|
|
|
|
|
|
it('should do nothing with normal globs', () => {
|
|
|
|
expect(resolveGroupSyntax('**/*.spec.js')).toStrictEqual([
|
2024-04-05 18:08:32 +00:00
|
|
|
'**/*.spec.js',
|
2023-01-20 16:23:16 +00:00
|
|
|
])
|
|
|
|
})
|
|
|
|
})
|