mirror of
https://github.com/actions/configure-pages.git
synced 2026-03-30 10:04:52 +00:00
Merge branch 'main' into dependabot/npm_and_yarn/eslint-8.33.0
This commit is contained in:
@@ -2,8 +2,7 @@ const fs = require('fs')
|
|||||||
const path = require('path')
|
const path = require('path')
|
||||||
const core = require('@actions/core')
|
const core = require('@actions/core')
|
||||||
|
|
||||||
const { getConfigParserSettings } = require('./set-pages-config')
|
const { setPagesConfig } = require('./set-pages-config')
|
||||||
const { ConfigParser } = require('./config-parser')
|
|
||||||
const { getTempFolder, compareFiles } = require('./test-helpers')
|
const { getTempFolder, compareFiles } = require('./test-helpers')
|
||||||
|
|
||||||
// Get the temp folder
|
// Get the temp folder
|
||||||
@@ -57,12 +56,12 @@ describe('configParser', () => {
|
|||||||
fs.rmSync(fixtureTargetFile)
|
fs.rmSync(fixtureTargetFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get settings for the static site generator
|
// Do the injections for the static site generator
|
||||||
const settings = getConfigParserSettings({ staticSiteGenerator, siteUrl })
|
setPagesConfig({
|
||||||
// Update the settings
|
staticSiteGenerator,
|
||||||
settings.configurationFile = fixtureTargetFile
|
generatorConfigFile: fixtureTargetFile,
|
||||||
// Do the injection
|
siteUrl
|
||||||
new ConfigParser(settings).injectAll()
|
})
|
||||||
|
|
||||||
// Read the expected file
|
// Read the expected file
|
||||||
const expectedFile = `${fixtureFolder}/${path.basename(
|
const expectedFile = `${fixtureFolder}/${path.basename(
|
||||||
@@ -71,7 +70,7 @@ describe('configParser', () => {
|
|||||||
)}.expected${defaultFileExtension}`
|
)}.expected${defaultFileExtension}`
|
||||||
|
|
||||||
// Compare the actual and expected files
|
// Compare the actual and expected files
|
||||||
compareFiles(settings.configurationFile, expectedFile)
|
compareFiles(fixtureTargetFile, expectedFile)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -90,16 +89,13 @@ describe('configParser', () => {
|
|||||||
fs.rmSync(fixtureTargetFile)
|
fs.rmSync(fixtureTargetFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get settings for the static site generator
|
// Do the injections for the static site generator
|
||||||
const settings = getConfigParserSettings({
|
setPagesConfig({
|
||||||
staticSiteGenerator,
|
staticSiteGenerator,
|
||||||
generatorConfigFile: fixtureTargetFile,
|
generatorConfigFile: fixtureTargetFile,
|
||||||
siteUrl
|
siteUrl
|
||||||
})
|
})
|
||||||
|
|
||||||
// Do the injection
|
|
||||||
new ConfigParser(settings).injectAll()
|
|
||||||
|
|
||||||
// Read the expected file
|
// Read the expected file
|
||||||
const expectedFile = `${fixtureFolder}/${path.basename(
|
const expectedFile = `${fixtureFolder}/${path.basename(
|
||||||
configurationFile,
|
configurationFile,
|
||||||
@@ -107,7 +103,7 @@ describe('configParser', () => {
|
|||||||
)}.expected${fileExtension}`
|
)}.expected${fileExtension}`
|
||||||
|
|
||||||
// Compare the actual and expected files
|
// Compare the actual and expected files
|
||||||
compareFiles(settings.configurationFile, expectedFile)
|
compareFiles(fixtureTargetFile, expectedFile)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user