Skip to content

Commit

Permalink
chore: fix accidental changes
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed Dec 24, 2019
1 parent e6c4833 commit f10bb6a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
4 changes: 3 additions & 1 deletion bin/templates/scripts/cordova/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,8 @@ Api.prototype.clean = function (cleanOptions) {
* @return {Promise<Requirement[]>} Promise, resolved with set of Requirement
* objects for current platform.
*/
Api.prototype.requirements = () => check_reqs.check_all();
Api.prototype.requirements = function () {
return check_reqs.check_all();
};

module.exports = Api;
10 changes: 6 additions & 4 deletions bin/templates/scripts/cordova/lib/Podfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function Podfile (podFilePath, projectName, minDeploymentTarget) {
}
}

Podfile.prototype.__parseForDeclarations = text => {
Podfile.prototype.__parseForDeclarations = function (text) {
// split by \n
const arr = text.split('\n');

Expand Down Expand Up @@ -108,7 +108,7 @@ Podfile.prototype.__parseForDeclarations = text => {
}, {});
};

Podfile.prototype.__parseForSources = text => {
Podfile.prototype.__parseForSources = function (text) {
// split by \n
const arr = text.split('\n');

Expand All @@ -128,7 +128,7 @@ Podfile.prototype.__parseForSources = text => {
}, {});
};

Podfile.prototype.__parseForPods = text => {
Podfile.prototype.__parseForPods = function (text) {
// split by \n
const arr = text.split('\n');

Expand Down Expand Up @@ -165,7 +165,9 @@ Podfile.prototype.__parseForPods = text => {
}, {});
};

Podfile.prototype.escapeSingleQuotes = string => string.replace(/'/g, '\\\'');
Podfile.prototype.escapeSingleQuotes = function (string) {
return string.replace(/'/g, '\\\'');
};

Podfile.prototype.getTemplate = function () {
// Escaping possible ' in the project name
Expand Down
20 changes: 12 additions & 8 deletions tests/spec/unit/lib/check_reqs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,25 @@ describe('check_reqs', () => {
);
});

it('should throw error because version is not following semver-notated.', () => checkTool('node', 'a.b.c').then(
() => fail('Expected promise to be rejected'),
err => expect(err).toEqual(new TypeError('Invalid Version: a.b.c'))
));
it('should throw error because version is not following semver-notated.', () => {
return checkTool('node', 'a.b.c').then(
() => fail('Expected promise to be rejected'),
err => expect(err).toEqual(new TypeError('Invalid Version: a.b.c'))
);
});

it('should resolve passing back tool version.', () => {
return checkTool('node', '1.0.0').then(result => {
expect(result).toEqual({ version: '1.0.0' });
});
});

it('should reject because tool does not meet minimum requirement.', () => checkTool('node', '1.0.1').then(
() => fail('Expected promise to be rejected'),
reason => expect(reason).toContain('version 1.0.1 or greater, you have version 1.0.0')
));
it('should reject because tool does not meet minimum requirement.', () => {
return checkTool('node', '1.0.1').then(
() => fail('Expected promise to be rejected'),
reason => expect(reason).toContain('version 1.0.1 or greater, you have version 1.0.0')
);
});
});

describe('check_cocoapods method', () => {
Expand Down

0 comments on commit f10bb6a

Please sign in to comment.