|
1 | 1 | import { isValidJsonFile, isValidPythonIdentifier } from './validation';
|
| 2 | +import { expect, test } from 'vitest'; |
2 | 3 |
|
3 | 4 | test('valid name starting with lower case letter', () => {
|
4 | 5 | const testString = 'hallo_welt';
|
5 |
| - expect(isValidPythonIdentifier(testString)).toBe(true); |
| 6 | + expect(isValidPythonIdentifier(testString)).toBeTruthy(); |
6 | 7 | });
|
7 | 8 |
|
8 | 9 | test('valid name starting with _', () => {
|
9 | 10 | const testString = '_hallo_welt';
|
10 |
| - expect(isValidPythonIdentifier(testString)).toBe(true); |
| 11 | + expect(isValidPythonIdentifier(testString)).toBeTruthy(); |
11 | 12 | });
|
12 | 13 |
|
13 | 14 | test('valid name starting with upper case letter', () => {
|
14 | 15 | const testString = 'Hallo_welt';
|
15 |
| - expect(isValidPythonIdentifier(testString)).toBe(true); |
| 16 | + expect(isValidPythonIdentifier(testString)).toBeTruthy(); |
16 | 17 | });
|
17 | 18 |
|
18 | 19 | test('invalid name with %', () => {
|
19 | 20 | const testString = 'Hallo%welt';
|
20 |
| - expect(isValidPythonIdentifier(testString)).toBe(false); |
| 21 | + expect(isValidPythonIdentifier(testString)).toBeFalsy(); |
21 | 22 | });
|
22 | 23 |
|
23 | 24 | test('invalid name starting with number', () => {
|
24 | 25 | const testString = '9Hallo_Welt';
|
25 |
| - expect(isValidPythonIdentifier(testString)).toBe(false); |
| 26 | + expect(isValidPythonIdentifier(testString)).toBeFalsy(); |
26 | 27 | });
|
27 | 28 |
|
28 | 29 | test('invalid json file name', () => {
|
29 | 30 | const testString = 'helloWorld.png';
|
30 |
| - expect(isValidJsonFile(testString)).toBe(false); |
| 31 | + expect(isValidJsonFile(testString)).toBeFalsy(); |
31 | 32 | });
|
32 | 33 |
|
33 | 34 | test('valid json file name', () => {
|
34 | 35 | const testString = 'helloWorld.json';
|
35 |
| - expect(isValidJsonFile(testString)).toBe(true); |
| 36 | + expect(isValidJsonFile(testString)).toBeTruthy(); |
36 | 37 | });
|
0 commit comments