Skip to content

Commit 2c28f21

Browse files
author
Lukas Holzer
authored
test: disable flaky tests on windows (#4101)
1 parent 5ba83d8 commit 2c28f21

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

tests/command.init.test.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { readFile } = require('fs').promises
2+
const process = require('process')
23

34
const test = require('ava')
45
const cleanDeep = require('clean-deep')
@@ -10,6 +11,13 @@ const { CONFIRM, DOWN, answerWithValue, handleQuestions } = require('./utils/han
1011
const { withMockApi } = require('./utils/mock-api')
1112
const { withSiteBuilder } = require('./utils/site-builder')
1213

14+
// TODO: Flaky tests enable once fixed
15+
/**
16+
* As some of the tests are flaky on windows machines I will skip them for now
17+
* @type {import('ava').TestInterface}
18+
*/
19+
const windowsSkip = process.platform === 'win32' ? test.skip : test
20+
1321
const assertNetlifyToml = async (t, tomlDir, { command, functions, publish }) => {
1422
// assert netlify.toml was created with user inputs
1523
const netlifyToml = toml.parse(await readFile(`${tomlDir}/netlify.toml`, 'utf8'))
@@ -388,7 +396,7 @@ test('netlify init existing Next.js site with existing plugins', async () => {
388396
})
389397
})
390398

391-
test('netlify init monorepo root and sub directory without netlify.toml', async (t) => {
399+
windowsSkip('netlify init monorepo root and sub directory without netlify.toml', async (t) => {
392400
const initQuestions = [
393401
{
394402
question: 'Create & configure a new site',

tests/command.link.test.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const process = require('process')
2+
13
const test = require('ava')
24

35
const { isFileAsync } = require('../src/lib/fs')
@@ -6,6 +8,13 @@ const callCli = require('./utils/call-cli')
68
const { getCLIOptions, withMockApi } = require('./utils/mock-api')
79
const { withSiteBuilder } = require('./utils/site-builder')
810

11+
// TODO: Flaky tests enable once fixed
12+
/**
13+
* As some of the tests are flaky on windows machines I will skip them for now
14+
* @type {import('ava').TestInterface}
15+
*/
16+
const windowsSkip = process.platform === 'win32' ? test.skip : test
17+
918
test('should create gitignore in repository root when is root', async (t) => {
1019
await withSiteBuilder('repo', async (builder) => {
1120
await builder.withGit().buildAsync()
@@ -18,7 +27,7 @@ test('should create gitignore in repository root when is root', async (t) => {
1827
})
1928
})
2029

21-
test('should create gitignore in repository root when cwd is subdirectory', async (t) => {
30+
windowsSkip('should create gitignore in repository root when cwd is subdirectory', async (t) => {
2231
await withSiteBuilder('monorepo', async (builder) => {
2332
const projectPath = 'projects/project1'
2433
await builder.withGit().withNetlifyToml({ config: {}, pathPrefix: projectPath }).buildAsync()

0 commit comments

Comments
 (0)