Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/eslint-8.33.0
Browse files Browse the repository at this point in the history
  • Loading branch information
James M. Greene authored and GitHub committed Feb 1, 2023
2 parents 5a80553 + 1d79de2 commit 5aa8bf5
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/set-pages-config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ const fs = require('fs')
const path = require('path')
const core = require('@actions/core')

const { getConfigParserSettings } = require('./set-pages-config')
const { ConfigParser } = require('./config-parser')
const { setPagesConfig } = require('./set-pages-config')
const { getTempFolder, compareFiles } = require('./test-helpers')

// Get the temp folder
Expand Down Expand Up @@ -57,12 +56,12 @@ describe('configParser', () => {
fs.rmSync(fixtureTargetFile)
}

// Get settings for the static site generator
const settings = getConfigParserSettings({ staticSiteGenerator, siteUrl })
// Update the settings
settings.configurationFile = fixtureTargetFile
// Do the injection
new ConfigParser(settings).injectAll()
// Do the injections for the static site generator
setPagesConfig({
staticSiteGenerator,
generatorConfigFile: fixtureTargetFile,
siteUrl
})

// Read the expected file
const expectedFile = `${fixtureFolder}/${path.basename(
Expand All @@ -71,7 +70,7 @@ describe('configParser', () => {
)}.expected${defaultFileExtension}`

// Compare the actual and expected files
compareFiles(settings.configurationFile, expectedFile)
compareFiles(fixtureTargetFile, expectedFile)
})
})

Expand All @@ -90,24 +89,21 @@ describe('configParser', () => {
fs.rmSync(fixtureTargetFile)
}

// Get settings for the static site generator
const settings = getConfigParserSettings({
// Do the injections for the static site generator
setPagesConfig({
staticSiteGenerator,
generatorConfigFile: fixtureTargetFile,
siteUrl
})

// Do the injection
new ConfigParser(settings).injectAll()

// Read the expected file
const expectedFile = `${fixtureFolder}/${path.basename(
configurationFile,
fileExtension
)}.expected${fileExtension}`

// Compare the actual and expected files
compareFiles(settings.configurationFile, expectedFile)
compareFiles(fixtureTargetFile, expectedFile)
})
})
})
Expand Down

0 comments on commit 5aa8bf5

Please sign in to comment.