Skip to content

Commit

Permalink
#1246: after-merge enhanced validation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Apr 14, 2024
1 parent 939312f commit fddf28a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/metadataTypes/DataExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class DataExtension extends MetadataType {
let upsertResults;
if (successfulResults.length > 0) {
const metadataResults = successfulResults
// @ts-expect-error not sure why this produces a type error. looks 100% correct
.map((r) => r.value.Results[0].Object)
.map((r) => {
// if only one fields added will return object otherwise array
Expand Down Expand Up @@ -171,6 +172,7 @@ class DataExtension extends MetadataType {
DataExtensionField.client = this.client;
DataExtensionField.properties = this.properties;
DataExtension.oldFields ||= {};
// @ts-expect-error not sure why this produces a type error. looks 100% correct
DataExtension.oldFields[metadataMap[metadataKey][this.definition.keyField]] =
await DataExtensionField.prepareDeployColumnsOnUpdate(
metadataMap[metadataKey].Fields,
Expand Down
4 changes: 3 additions & 1 deletion test/resourceFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { XMLParser } from 'fast-xml-parser';
import { Util } from '../lib/util/util.js';
const parser = new XMLParser();
const attributeParser = new XMLParser({ ignoreAttributes: false });
/** @type {typeof Util.color} */
let color;

/* eslint-disable unicorn/prefer-ternary */
Expand All @@ -12,6 +13,7 @@ if (
process.env.VSCODE_CRASH_REPORTER_PROCESS_TYPE === 'extensionHost'
) {
// when we execute the test in a VSCode extension host, we don't want CLI color codes.
// @ts-expect-error hacky way to get rid of colors - ts doesn't appreciate the hack
color = new Proxy(
{},
{
Expand All @@ -38,7 +40,7 @@ if (
* @param {string} type metadata Type
* @param {string} mid of Business Unit
* @param {object|string} filter likely for customer key
* @returns {string} relevant metadata stringified
* @returns {Promise.<string>} relevant metadata stringified
*/
async function loadSOAPRecords(mcdevAction, type, mid, filter) {
type = type[0].toLowerCase() + type.slice(1);
Expand Down
3 changes: 3 additions & 0 deletions test/type.asset.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ describe('type: asset', () => {
assert.equal(process.exitCode, 0, 'resolveId should not have thrown an error');
assert.deepEqual(
resolveIdJson,
// @ts-expect-error bad typing of assert.deepEqual
await testUtils.getExpectedJson('9999999', 'asset', 'resolveId-1295064-noPath'),
'returned response was not equal expected'
);
Expand Down Expand Up @@ -142,6 +143,7 @@ describe('type: asset', () => {
assert.equal(process.exitCode, 0, 'resolveId should not have thrown an error');
assert.deepEqual(
resolveIdJson,
// @ts-expect-error bad typing of assert.deepEqual
await testUtils.getExpectedJson('9999999', 'asset', 'resolveId-1295064-withPath'),
'returned response was not equal expected'
);
Expand All @@ -156,6 +158,7 @@ describe('type: asset', () => {
// IMPORTANT: this will throw a false "TEST-ERROR" but our testing framework currently needs to not find the file to throw a 404
assert.deepEqual(
resolveIdJson,
// @ts-expect-error bad typing of assert.deepEqual
await testUtils.getExpectedJson('9999999', 'asset', 'resolveId-1234-notFound'),
'returned response was not equal expected'
);
Expand Down

0 comments on commit fddf28a

Please sign in to comment.