Hoist important arrays to top-level constants

This commit is contained in:
James M. Greene
2022-08-05 17:37:00 -05:00
parent 7c3932ff89
commit 1395534a78

View File

@@ -9,6 +9,9 @@ const { getTempFolder, compareFiles } = require('./test-helpers')
// Get the temp folder
const tempFolder = getTempFolder()
const SUPPORTED_GENERATORS = ['next', 'nuxt', 'gatsby']
const SUPPORTED_FILE_EXTENSIONS = ['.js', '.cjs', '.mjs']
// Test suite
describe('configParser', () => {
beforeEach(() => {
@@ -22,7 +25,7 @@ describe('configParser', () => {
})
// Iterate over the static site generators
;['next', 'nuxt', 'gatsby'].forEach(staticSiteGenerator => {
SUPPORTED_GENERATORS.forEach(staticSiteGenerator => {
// Folder containing the fixtures for a given static site generator
const fixtureFolder = `${__dirname}/fixtures/${staticSiteGenerator}`
@@ -61,7 +64,8 @@ describe('configParser', () => {
compareFiles(settings.configurationFile, expectedFile)
})
})
;['.js', '.cjs', '.mjs'].forEach(fileExtension => {
SUPPORTED_FILE_EXTENSIONS.forEach(fileExtension => {
// Iterate over the fixtures, outputting to specified configuration file path
configurationFiles
.filter(filename => filename.endsWith(fileExtension))