Skip to content

Commit dd66f60

Browse files
committed
Allow spec files to be next to related files
1 parent f3b38dc commit dd66f60

3 files changed

Lines changed: 18 additions & 2 deletions

File tree

eslint.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default defineConfigWithVueTs(
1919
vueTsConfigs.recommended,
2020
{
2121
...pluginVitest.configs.recommended,
22-
files: ['src/**/__tests__/*'],
22+
files: ['src/**/__tests__/*', 'src/**/*.{spec,test}.*'],
2323
},
2424
...pluginOxlint.buildFromOxlintConfigFile('.oxlintrc.json'),
2525
prettier,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { isEmoji } from '#utils/emoji.ts';
21
import { describe, expect, it } from 'vitest';
2+
import { isEmoji } from './emoji.ts';
33

44
describe('emoji', () => {
55
it('detects emojis', () => {

src/utils/user.spec.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { describe, expect, it } from 'vitest';
2+
import { parseNick, parseUid } from './user';
3+
4+
describe('user', () => {
5+
it('parses username from nick', () => {
6+
expect(parseNick('AnotherUser')).toBe('AnotherUser');
7+
expect(parseNick('Anonymous^12')).toBe('Anonymous');
8+
expect(parseNick('Chatter__123^1')).toBe('Chatter');
9+
});
10+
11+
it('parses UID from ident or former nick format', () => {
12+
expect(parseUid('AnotherUser', 'anon')).toBe('anon');
13+
expect(parseUid('Anonymous^456', '67890')).toBe('67890');
14+
expect(parseUid('Chatter__123^1', 'anon')).toBe('123');
15+
});
16+
});

0 commit comments

Comments
 (0)