|
1 | 1 | /* eslint-disable no-console */
|
2 | 2 |
|
3 |
| -import { it } from "vitest"; |
4 |
| -import { prettyDOM } from "@testing-library/dom" |
| 3 | +import { afterAll, beforeAll, it, describe, expect } from "vitest"; |
| 4 | +import { prettyDOM } from "@testing-library/dom"; |
5 | 5 |
|
6 | 6 | // https://github.com/vitest-dev/vitest/issues/2765
|
7 | 7 | it('regexp', () => {
|
@@ -31,3 +31,42 @@ it('html-pretty', () => {
|
31 | 31 | `.replaceAll(/\n */gm, ""); // strip new liens
|
32 | 32 | console.log(prettyDOM(div))
|
33 | 33 | })
|
| 34 | + |
| 35 | + |
| 36 | +beforeAll(() => { |
| 37 | + console.log('beforeAll') |
| 38 | + console.error('beforeAll') |
| 39 | +}) |
| 40 | + |
| 41 | +afterAll(() => { |
| 42 | + console.log('afterAll') |
| 43 | + console.error('afterAll') |
| 44 | +}) |
| 45 | + |
| 46 | +describe('suite', () => { |
| 47 | + beforeAll(() => { |
| 48 | + console.log('beforeAll') |
| 49 | + console.error('beforeAll') |
| 50 | + }) |
| 51 | + |
| 52 | + afterAll(() => { |
| 53 | + console.log('afterAll') |
| 54 | + console.error('afterAll') |
| 55 | + }) |
| 56 | + |
| 57 | + describe('nested suite', () => { |
| 58 | + beforeAll(() => { |
| 59 | + console.log('beforeAll') |
| 60 | + console.error('beforeAll') |
| 61 | + }) |
| 62 | + |
| 63 | + afterAll(() => { |
| 64 | + console.log('afterAll') |
| 65 | + console.error('afterAll') |
| 66 | + }) |
| 67 | + |
| 68 | + it('test', () => { |
| 69 | + expect(true).toBe(true) |
| 70 | + }) |
| 71 | + }) |
| 72 | +}) |
0 commit comments