typescript-assistant
Version:
Combines and integrates professional Typescript tools into your project
26 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const childProcess = require("child_process");
const sinon_1 = require("sinon");
const helpers_1 = require("../src/helpers");
const chai_1 = require("chai");
describe('git-helper', () => {
let execSync;
beforeEach(() => {
execSync = sinon_1.stub(childProcess, 'execSync');
});
afterEach(() => {
execSync.restore();
});
it('can tell which files have changed', () => {
execSync.returns(`package.json
tools/githooks/post-checkout.ts
tools/githooks/post-merge.ts`);
chai_1.expect(helpers_1.findChangedFiles('ORIG_HEAD', 'HEAD')).to.deep.equal(['package.json', 'tools/githooks/post-checkout.ts', 'tools/githooks/post-merge.ts']);
});
it('can tell if package.json has changed', () => {
execSync.returns(`package.json`);
chai_1.expect(helpers_1.packageJsonChanged('ORIG_HEAD', 'HEAD')).to.be.true;
});
});
//# sourceMappingURL=helpers-tests.js.map