feat(core): align GitHub metadata handling with other backends (#3316)
* Revert "Revert "feat(core): Align GitHub metadata handling with other backends (#3292)"" This reverts commit 5bdd3df9ccbb5149c22d79987ebdcd6cab4b261f. * fix(backend-github): fix migration code * test(backend-github): fix test * test(e2e): shorten wait time * test(e2e): try and fix test on CI
This commit is contained in:
@ -24,4 +24,19 @@ async function updateConfig(configModifier) {
|
||||
await fs.writeFileSync(configFile, yaml.safeDump(config));
|
||||
}
|
||||
|
||||
module.exports = { copyBackendFiles, updateConfig };
|
||||
async function switchVersion(version) {
|
||||
const htmlFile = path.join(devTestDirectory, 'index.html');
|
||||
const content = await fs.readFile(htmlFile);
|
||||
|
||||
const replaceString =
|
||||
version === 'latest'
|
||||
? '<script src="dist/netlify-cms.js"></script>'
|
||||
: `<script src="https://unpkg.com/netlify-cms@${version}/dist/netlify-cms.js"></script>`;
|
||||
|
||||
await fs.writeFile(
|
||||
htmlFile,
|
||||
content.toString().replace(/<script src=".+?netlify-cms.+?"><\/script>/, replaceString),
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = { copyBackendFiles, updateConfig, switchVersion };
|
||||
|
@ -200,7 +200,7 @@ function flushClockAndSave() {
|
||||
|
||||
function populateEntry(entry, onDone = flushClockAndSave) {
|
||||
const keys = Object.keys(entry);
|
||||
for (let key of keys) {
|
||||
for (const key of keys) {
|
||||
const value = entry[key];
|
||||
if (key === 'body') {
|
||||
cy.getMarkdownEditor()
|
||||
|
Reference in New Issue
Block a user