Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const { default: runProgram } = require("./utils/runProgram");
const generateProject = require("./utils/generateProject");
const expect = require("unexpected");
const util = require("util");
const exec = util.promisify(require("child_process").exec);
const chalk = require("chalk");
expect.addAssertion(
" when run ",
async (expect, cmd, assertion, compare) => {
const result = await exec(cmd);
return result.stderr
? expect.fail(new Error(`Command errored: ${result.sdterr}`))
: expect(result.stdout.trim(), assertion, compare);
}
);
describe("Git features", async () => {
it("correctly adds git commit and branch", async () => {
// eslint-disable-next-line
jest.setTimeout(100000);
const projectPath = await generateProject({
name: "project-a",
git: true,
name: 'Sequelize.Association',
identify: function (value) {
return value && value instanceof Sequelize.Association;
},
inspect: function (value, depth, output) {
output
.text(value.associationType).text(': ')
.text(value.source.name).text(' -> ').text(value.target.name)
.text('(').text(value.as).text(')');
},
equal: function (a, b, equal) {
return a.associationType === b.associationType && equal(a.source, b.source) && equal(a.target, b.target) && a.as === b.as;
}
});
unexpected.addAssertion(' [not] to be shimmed', function (expect, subject) {
return expect(subject, '[not] to have property', '__wrapped');
});