diff --git a/tests/command.init.test.js b/tests/command.init.test.js index f517f38d7d0..d529f51fb14 100644 --- a/tests/command.init.test.js +++ b/tests/command.init.test.js @@ -1,4 +1,5 @@ const { readFile } = require('fs').promises +const process = require('process') const test = require('ava') const cleanDeep = require('clean-deep') @@ -10,6 +11,13 @@ const { CONFIRM, DOWN, answerWithValue, handleQuestions } = require('./utils/han const { withMockApi } = require('./utils/mock-api') const { withSiteBuilder } = require('./utils/site-builder') +// TODO: Flaky tests enable once fixed +/** + * As some of the tests are flaky on windows machines I will skip them for now + * @type {import('ava').TestInterface} + */ +const windowsSkip = process.platform === 'win32' ? test.skip : test + const assertNetlifyToml = async (t, tomlDir, { command, functions, publish }) => { // assert netlify.toml was created with user inputs 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 () => { }) }) -test('netlify init monorepo root and sub directory without netlify.toml', async (t) => { +windowsSkip('netlify init monorepo root and sub directory without netlify.toml', async (t) => { const initQuestions = [ { question: 'Create & configure a new site', diff --git a/tests/command.link.test.js b/tests/command.link.test.js index eb02f52ec97..3bb43d9d590 100644 --- a/tests/command.link.test.js +++ b/tests/command.link.test.js @@ -1,3 +1,5 @@ +const process = require('process') + const test = require('ava') const { isFileAsync } = require('../src/lib/fs') @@ -6,6 +8,13 @@ const callCli = require('./utils/call-cli') const { getCLIOptions, withMockApi } = require('./utils/mock-api') const { withSiteBuilder } = require('./utils/site-builder') +// TODO: Flaky tests enable once fixed +/** + * As some of the tests are flaky on windows machines I will skip them for now + * @type {import('ava').TestInterface} + */ +const windowsSkip = process.platform === 'win32' ? test.skip : test + test('should create gitignore in repository root when is root', async (t) => { await withSiteBuilder('repo', async (builder) => { await builder.withGit().buildAsync() @@ -18,7 +27,7 @@ test('should create gitignore in repository root when is root', async (t) => { }) }) -test('should create gitignore in repository root when cwd is subdirectory', async (t) => { +windowsSkip('should create gitignore in repository root when cwd is subdirectory', async (t) => { await withSiteBuilder('monorepo', async (builder) => { const projectPath = 'projects/project1' await builder.withGit().withNetlifyToml({ config: {}, pathPrefix: projectPath }).buildAsync()