Skip to content

Commit

Permalink
rebase and comment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshspicer authored Aug 4, 2022
1 parent 45541ba commit eec2f0f
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/test/container-features/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,20 @@ const assertFeatureIdInvariant = (id: string) => {
describe('validate processFeatureIdentifier', async function () {
// const VALID_TYPES = ['local-cache', 'github-repo', 'direct-tarball', 'file-path', 'oci'];


// In the real implementation, the cwd is passed by the calling function with the value of `--workspace-folder`.
// See: https://github.com/devcontainers/cli/blob/45541ba21437bf6c16826762f084ab502157789b/src/spec-node/devContainersSpecCLI.ts#L152-L153
const cwd = process.cwd();
console.log(`cwd: ${cwd}`);

describe('VALID processFeatureIdentifier examples', async function () {
it('should process local-cache', async function () {
// Parsed out of a user's devcontainer.json
let userFeature: DevContainerFeature = {
id: 'docker-in-docker',
options: {}
};
const featureSet = await processFeatureIdentifier(output, process.env, userFeature);
const featureSet = await processFeatureIdentifier(output, process.env, cwd, userFeature);
if (!featureSet) {
assert.fail('processFeatureIdentifier returned null');
}
Expand All @@ -72,7 +78,7 @@ describe('validate processFeatureIdentifier', async function () {
id: 'octocat/myfeatures/helloworld',
options: {},
};
const featureSet = await processFeatureIdentifier(output, process.env, feature);
const featureSet = await processFeatureIdentifier(output, process.env, cwd, feature);
if (!featureSet) {
assert.fail('processFeatureIdentifier returned null');
}
Expand All @@ -98,7 +104,7 @@ describe('validate processFeatureIdentifier', async function () {
id: 'octocat/myfeatures/helloworld@v0.0.4',
options: {},
};
const featureSet = await processFeatureIdentifier(output, process.env, feature);
const featureSet = await processFeatureIdentifier(output, process.env, cwd, feature);
if (!featureSet) {
assert.fail('processFeatureIdentifier returned null');
}
Expand Down Expand Up @@ -142,7 +148,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const featureSet = await processFeatureIdentifier(output, process.env, feature);
const featureSet = await processFeatureIdentifier(output, process.env, cwd, feature);
if (!featureSet) {
assert.fail('processFeatureIdentifier returned null');
}
Expand All @@ -160,10 +166,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const cwd = process.cwd();
console.log(`cwd: ${cwd}`);

const featureSet = await processFeatureIdentifier(output, process.env, feature);
const featureSet = await processFeatureIdentifier(output, process.env, cwd, feature);
if (!featureSet) {
assert.fail('processFeatureIdentifier returned null');
}
Expand All @@ -180,10 +183,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const cwd = process.cwd();
console.log(`cwd: ${cwd}`);

const featureSet = await processFeatureIdentifier(output, process.env, feature);
const featureSet = await processFeatureIdentifier(output, process.env, cwd, feature);
if (!featureSet) {
assert.fail('processFeatureIdentifier returned null');
}
Expand All @@ -201,7 +201,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const featureSet = await processFeatureIdentifier(output, process.env, feature);
const featureSet = await processFeatureIdentifier(output, process.env, cwd, feature);
if (!featureSet) {
assert.fail('processFeatureIdentifier returned null');
}
Expand All @@ -220,7 +220,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const featureSet = await processFeatureIdentifier(output, process.env, feature);
const featureSet = await processFeatureIdentifier(output, process.env, cwd, feature);
if (!featureSet) {
assert.fail('processFeatureIdentifier returned null');
}
Expand Down Expand Up @@ -253,7 +253,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const featureSet = await processFeatureIdentifier(output, process.env, feature);
const featureSet = await processFeatureIdentifier(output, process.env, cwd, feature);
if (!featureSet) {
assert.fail('processFeatureIdentifier returned null');
}
Expand Down Expand Up @@ -288,7 +288,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const result = await processFeatureIdentifier(output, process.env, feature);
const result = await processFeatureIdentifier(output, process.env, cwd, feature);
assert.notExists(result);
});

Expand All @@ -298,7 +298,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const result = await processFeatureIdentifier(output, process.env, feature);
const result = await processFeatureIdentifier(output, process.env, cwd, feature);
assert.notExists(result);
});

Expand All @@ -308,7 +308,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const result = await processFeatureIdentifier(output, process.env, feature);
const result = await processFeatureIdentifier(output, process.env, cwd, feature);
assert.notExists(result);
});

Expand All @@ -318,7 +318,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const result = await processFeatureIdentifier(output, process.env, feature);
const result = await processFeatureIdentifier(output, process.env, cwd, feature);
assert.notExists(result);
});

Expand All @@ -328,7 +328,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const result = await processFeatureIdentifier(output, process.env, feature);
const result = await processFeatureIdentifier(output, process.env, cwd, feature);
assert.notExists(result);
});

Expand All @@ -338,7 +338,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const result = await processFeatureIdentifier(output, process.env, feature);
const result = await processFeatureIdentifier(output, process.env, cwd, feature);
assert.notExists(result);
});

Expand All @@ -348,7 +348,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const result = await processFeatureIdentifier(output, process.env, feature);
const result = await processFeatureIdentifier(output, process.env, cwd, feature);
assert.notExists(result);
});

Expand All @@ -358,7 +358,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const result = await processFeatureIdentifier(output, process.env, feature);
const result = await processFeatureIdentifier(output, process.env, cwd, feature);
assert.notExists(result);
});

Expand All @@ -368,7 +368,7 @@ describe('validate processFeatureIdentifier', async function () {
options: {},
};

const result = await processFeatureIdentifier(output, process.env, feature);
const result = await processFeatureIdentifier(output, process.env, cwd, feature);
assert.notExists(result);
});
});
Expand Down

0 comments on commit eec2f0f

Please sign in to comment.