Skip to content

Commit

Permalink
Merge branch 'main' into netligraph-poc
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasholzer authored Jan 21, 2022
2 parents b9d66bd + 2c28f21 commit 22689d6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 9 additions & 1 deletion tests/command.init.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const { readFile } = require('fs').promises
const process = require('process')

const test = require('ava')
const cleanDeep = require('clean-deep')
Expand All @@ -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'))
Expand Down Expand Up @@ -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',
Expand Down
11 changes: 10 additions & 1 deletion tests/command.link.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const process = require('process')

const test = require('ava')

const { isFileAsync } = require('../src/lib/fs')
Expand All @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 22689d6

Please sign in to comment.