|
1 | 1 | import { resolve } from 'pathe' |
2 | 2 | import { glob } from 'tinyglobby' |
3 | 3 | import { describe, expect, it } from 'vitest' |
4 | | -import { runVitest } from '../../test-utils' |
| 4 | +import { runVitest, runVitestCli } from '../../test-utils' |
5 | 5 |
|
6 | 6 | describe('should fail', async () => { |
7 | 7 | const root = resolve(import.meta.dirname, '../failing') |
@@ -117,6 +117,26 @@ describe('ignoreSourceErrors', () => { |
117 | 117 | }) |
118 | 118 | }) |
119 | 119 |
|
| 120 | +describe('experimental warning', () => { |
| 121 | + const root = resolve(import.meta.dirname, '../fixtures/dynamic-title') |
| 122 | + const warning = 'Testing types with tsc and vue-tsc is an experimental feature.' |
| 123 | + |
| 124 | + it('is printed by default', async () => { |
| 125 | + const { stderr } = await runVitestCli('--root', root, '--run') |
| 126 | + expect(stderr).toContain(warning) |
| 127 | + }) |
| 128 | + |
| 129 | + it('is hidden with VITEST_DISABLE_EXPERIMENTAL_LOG', async () => { |
| 130 | + const { stderr } = await runVitestCli( |
| 131 | + { nodeOptions: { env: { VITEST_DISABLE_EXPERIMENTAL_LOG: 'true' } } }, |
| 132 | + '--root', |
| 133 | + root, |
| 134 | + '--run', |
| 135 | + ) |
| 136 | + expect(stderr).not.toContain(warning) |
| 137 | + }) |
| 138 | +}) |
| 139 | + |
120 | 140 | describe('when the title is dynamic', () => { |
121 | 141 | it('works correctly', async () => { |
122 | 142 | const vitest = await runVitest({ |
|
0 commit comments