Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

Commit

Permalink
Merge pull request #267 from amtrack/test/reorganize
Browse files Browse the repository at this point in the history
test: reorganize changeset test
  • Loading branch information
amtrack authored Sep 9, 2020
2 parents 8d4fbc6 + a7bf39b commit 90ef3d1
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 63 deletions.
63 changes: 0 additions & 63 deletions test-integration/changeset.js

This file was deleted.

52 changes: 52 additions & 0 deletions test/cli/changeset.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,56 @@ describe("force-dev-tool changeset", function() {
assert.deepEqual(changesetCreateCmd.status, 0);
assert(new RegExp("38.0").test(changesetCreateCmd.stdout.toString()));
});
var explicitTests = [{
gitCloneUrl: "https://github.com/amtrack/sfdx-playground.git",
branch: "explicit-custom-field",
description: "should extract a single CustomField from a CustomObject",
patterns: ["CustomField/Account.VAT_Number__c"],
unpackaged_path: "src",
expected: path.join("config", "deployments", "expected")
}];
explicitTests.forEach(function(test) {
it(test.description, function() {
if (test.skip) {
this.skip();
}
this.slow(5000);
this.timeout(20000);
var tmpobj = tmp.dirSync();
var gitDir = tmpobj.name;
var gitCloneCmd = child.spawnSync(
"git", ["clone", "-c", "core.autocrlf=false", test.gitCloneUrl, gitDir], {
cwd: gitDir
}
);
assert.deepEqual(gitCloneCmd.status, 0, gitCloneCmd.stderr.toString());
var gitCheckoutCmd = child.spawnSync("git", ["checkout", test.branch], {
cwd: gitDir
});
assert.deepEqual(gitCheckoutCmd.status, 0, gitCheckoutCmd.stderr.toString());
var changesetArgs = [fdt, "changeset", "create", "test"];
[].push.apply(changesetArgs, test.patterns);
var changesetCreateCmd = child.spawnSync(
"node", changesetArgs, {
cwd: gitDir
}
);
assert.deepEqual(
changesetCreateCmd.status,
0,
changesetCreateCmd.stdout.toString()
);
var diffDirsCmd = child.spawnSync(
"diff", [
"-u",
"-r",
path.join(gitDir, test.expected),
path.join(gitDir, "config", "deployments", "test")
], {
cwd: gitDir
}
);
assert.deepEqual(diffDirsCmd.status, 0, diffDirsCmd.stdout.toString());
});
});
});

0 comments on commit 90ef3d1

Please sign in to comment.