mirror of
https://github.com/actions/configure-pages.git
synced 2026-03-30 10:04:52 +00:00
Add support for specifying the target generator config file
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const fs = require('fs')
|
||||
const core = require('@actions/core')
|
||||
|
||||
const { ConfigParser } = require('./config-parser')
|
||||
const { getTempFolder, compareFiles } = require('./test-helpers')
|
||||
@@ -134,8 +135,18 @@ const cases = [
|
||||
]
|
||||
|
||||
describe('config-parser', () => {
|
||||
beforeEach(() => {
|
||||
jest.restoreAllMocks()
|
||||
|
||||
// Mock error/warning/info/debug to silence their output
|
||||
jest.spyOn(core, 'error').mockImplementation(jest.fn())
|
||||
jest.spyOn(core, 'warning').mockImplementation(jest.fn())
|
||||
jest.spyOn(core, 'info').mockImplementation(jest.fn())
|
||||
jest.spyOn(core, 'debug').mockImplementation(jest.fn())
|
||||
})
|
||||
|
||||
cases.forEach(({ property, source, expected }, index) => {
|
||||
it(`Inject path properly for case #${index}`, () => {
|
||||
it(`injects path properly for case #${index}`, () => {
|
||||
// Write the source file
|
||||
const sourceFile = `${tempFolder}/source.js`
|
||||
fs.writeFileSync(sourceFile, source, { encoding: 'utf8' })
|
||||
|
||||
Reference in New Issue
Block a user