Skip to content

Commit f86df48

Browse files
committed
test: add example Vitest test suite with basic assertions
Add example test file demonstrating Vitest usage with basic assertions for numbers, arrays, and objects
1 parent 9c874b5 commit f86df48

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

resources/js/example.spec.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { describe, expect, it } from 'vitest';
2+
3+
describe('Example Test Suite', () => {
4+
it('should pass a basic assertion', () => {
5+
expect(1 + 1).toBe(2);
6+
});
7+
8+
it('should work with arrays', () => {
9+
const items = ['apple', 'banana', 'cherry'];
10+
expect(items).toHaveLength(3);
11+
expect(items).toContain('banana');
12+
});
13+
14+
it('should work with objects', () => {
15+
const user = { name: 'John', age: 30 };
16+
expect(user).toHaveProperty('name');
17+
expect(user.name).toBe('John');
18+
});
19+
});

0 commit comments

Comments
 (0)