Refactor parameter serialization into TaskParameterSerializer

pull/310/head
Frostebite 2021-12-23 20:11:32 +00:00
parent 3a5b7a4501
commit 90b9835bce
1 changed files with 3 additions and 4 deletions

View File

@ -27,14 +27,13 @@ describe('Cloud Runner', () => {
buildParameter.logToFile = true; buildParameter.logToFile = true;
const baseImage = new ImageTag(buildParameter); const baseImage = new ImageTag(buildParameter);
await CloudRunner.run(buildParameter, baseImage.toString()); await CloudRunner.run(buildParameter, baseImage.toString());
const file = fs.readFileSync(`${CloudRunnerState.buildGuid}-outputfile.txt`, 'utf-8').toString(); let file = fs.readFileSync(`${CloudRunnerState.buildGuid}-outputfile.txt`, 'utf-8').toString();
expect(file).toContain(JSON.stringify(buildParameter)); expect(file).toContain(JSON.stringify(buildParameter));
file = file.replace(`\n`, ``).replace(` `, ``);
const inputKeys = Object.getOwnPropertyNames(Input); const inputKeys = Object.getOwnPropertyNames(Input);
for (const element of inputKeys) { for (const element of inputKeys) {
if (Input[element] !== undefined && typeof Input[element] != 'function') { if (Input[element] !== undefined && typeof Input[element] != 'function') {
expect(file.replace(`\n`, ``).replace(` `, ``)).toContain( expect(file).toContain(`${element}=${Input[element].toString().replace(`\n`, ``).replace(` `, ``)}`);
`${element}=${Input[element].toString().replace(`\n`, ``).replace(` `, ``)}`,
);
} }
} }
} }