Skip to content

Commit 016f690

Browse files
committed
refactor: fix arrow return formatting
1 parent a0d55b5 commit 016f690

File tree

3 files changed

+45
-29
lines changed

3 files changed

+45
-29
lines changed

tests/spec/component/versions.spec.js

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,36 @@ const versions = rewire('../../../bin/templates/scripts/cordova/lib/versions');
2424
if (process.platform === 'darwin') {
2525
describe('versions', () => {
2626
describe('get_tool_version method', () => {
27-
it('should not have found tool by name.', () => versions.get_tool_version('unknown').then(
28-
() => fail('expected promise rejection'),
29-
error => expect(error).toContain('is not valid tool name')
30-
));
31-
32-
it('should find xcodebuild version.', () => versions.get_tool_version('xcodebuild').then((version) => {
33-
expect(version).not.toBe(undefined);
34-
}));
35-
36-
it('should find ios-sim version.', () => versions.get_tool_version('ios-sim').then((version) => {
37-
expect(version).not.toBe(undefined);
38-
}));
39-
40-
it('should find ios-deploy version.', () => versions.get_tool_version('ios-deploy').then((version) => {
41-
expect(version).not.toBe(undefined);
42-
}));
43-
44-
it('should find pod version.', () => versions.get_tool_version('pod').then((version) => {
45-
expect(version).not.toBe(undefined);
46-
}));
27+
it('should not have found tool by name.', () => {
28+
return versions.get_tool_version('unknown').then(
29+
() => fail('expected promise rejection'),
30+
error => expect(error).toContain('is not valid tool name')
31+
);
32+
});
33+
34+
it('should find xcodebuild version.', () => {
35+
return versions.get_tool_version('xcodebuild').then((version) => {
36+
expect(version).not.toBe(undefined);
37+
});
38+
});
39+
40+
it('should find ios-sim version.', () => {
41+
return versions.get_tool_version('ios-sim').then((version) => {
42+
expect(version).not.toBe(undefined);
43+
});
44+
});
45+
46+
it('should find ios-deploy version.', () => {
47+
return versions.get_tool_version('ios-deploy').then((version) => {
48+
expect(version).not.toBe(undefined);
49+
});
50+
});
51+
52+
it('should find pod version.', () => {
53+
return versions.get_tool_version('pod').then((version) => {
54+
expect(version).not.toBe(undefined);
55+
});
56+
});
4757
});
4858
});
4959
}

tests/spec/unit/lib/check_reqs.spec.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ describe('check_reqs', () => {
5151
err => expect(err).toEqual(new TypeError('Invalid Version: a.b.c'))
5252
));
5353

54-
it('should resolve passing back tool version.', () => checkTool('node', '1.0.0').then(result => {
55-
expect(result).toEqual({ version: '1.0.0' });
56-
}));
54+
it('should resolve passing back tool version.', () => {
55+
return checkTool('node', '1.0.0').then(result => {
56+
expect(result).toEqual({ version: '1.0.0' });
57+
});
58+
});
5759

5860
it('should reject because tool does not meet minimum requirement.', () => checkTool('node', '1.0.1').then(
5961
() => fail('Expected promise to be rejected'),

tests/spec/unit/versions.spec.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,19 @@ if (process.platform === 'darwin') {
2828
});
2929

3030
describe('get_apple_ios_version method', () => {
31-
it('should have found ios version.', () => versions.get_apple_ios_version().then(() => {
32-
expect(console.log).not.toHaveBeenCalledWith(undefined);
33-
}));
31+
it('should have found ios version.', () => {
32+
return versions.get_apple_ios_version().then(() => {
33+
expect(console.log).not.toHaveBeenCalledWith(undefined);
34+
});
35+
});
3436
});
3537

3638
describe('get_apple_osx_version method', () => {
37-
it('should have found osx version.', () => versions.get_apple_osx_version().then(() => {
38-
expect(console.log).not.toHaveBeenCalledWith(undefined);
39-
}));
39+
it('should have found osx version.', () => {
40+
return versions.get_apple_osx_version().then(() => {
41+
expect(console.log).not.toHaveBeenCalledWith(undefined);
42+
});
43+
});
4044
});
4145
});
4246
}

0 commit comments

Comments
 (0)