Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let Jasmine handle async test results #619

Merged
merged 2 commits into from
Jun 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 41 additions & 110 deletions integration-tests/HooksRunner.spec.js

Large diffs are not rendered by default.

44 changes: 15 additions & 29 deletions integration-tests/fetch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ describe('end-to-end plugin dependency tests', function () {
shell.rm('-rf', tmpDir);
});

it('Test 029 : should fail if dependency already installed is wrong version', function (done) {
cordova.create('hello3')
it('Test 029 : should fail if dependency already installed is wrong version', function () {
return cordova.create('hello3')
.then(function () {
process.chdir(project);
return cordova.platform('add', 'android', {'fetch': true});
Expand All @@ -59,12 +59,11 @@ describe('end-to-end plugin dependency tests', function () {
return cordova.plugin('add', plugins['Test1'], {'fetch': true});
}).fail(function (err) {
expect(err.message).toContain('does not satisfy dependency plugin requirement');
})
.fin(done);
});
}, TIMEOUT);

it('Test 030 : should pass if dependency already installed is wrong version with --force', function (done) {
cordova.create('hello3')
it('Test 030 : should pass if dependency already installed is wrong version with --force', function () {
return cordova.create('hello3')
.then(function () {
process.chdir(project);
return cordova.platform('add', 'android', {'fetch': true});
Expand All @@ -78,16 +77,12 @@ describe('end-to-end plugin dependency tests', function () {
})
.then(function () {
expect(path.join(pluginsDir, 'Test1')).toExist();
})
.fail(function (err) {
expect(err).toBeUndefined();
})
.fin(done);
});
}, TIMEOUT);

it('Test 031 : should pass if dependency already installed is same major version (if specific version is specified)', function (done) {
it('Test 031 : should pass if dependency already installed is same major version (if specific version is specified)', function () {
// Test1 requires cordova-plugin-file version 2.0.0 (which should automatically turn into ^2.0.0); we'll install version 2.1.0
cordova.create('hello3')
return cordova.create('hello3')
.then(function () {
process.chdir(project);
return cordova.platform('add', 'android', {'fetch': true});
Expand All @@ -101,18 +96,13 @@ describe('end-to-end plugin dependency tests', function () {
})
.then(function () {
expect(path.join(pluginsDir, 'Test1')).toExist();
})
.fail(function (err) {
// console.error(err);
expect(err).toBeUndefined();
})
.fin(done);
});
}, TIMEOUT);

it('Test 032 : should handle two plugins with same dependent plugin', function (done) {
it('Test 032 : should handle two plugins with same dependent plugin', function () {
// Test1 and Test2 have compatible dependencies on cordova-plugin-file
// Test1 and Test3 have incompatible dependencies on cordova-plugin-file
cordova.create('hello3')
return cordova.create('hello3')
.then(function () {
process.chdir(project);
return cordova.platform('add', 'android', {'fetch': true});
Expand All @@ -132,14 +122,13 @@ describe('end-to-end plugin dependency tests', function () {
expect(path.join(pluginsDir, 'Test2')).toExist();
expect(path.join(pluginsDir, 'Test3')).not.toExist();
expect(err.message).toContain('does not satisfy dependency plugin requirement');
}, TIMEOUT)
.fin(done);
}, TIMEOUT);
}, TIMEOUT);

it('Test 033 : should use a dev version of a dependent plugin if it is already installed', function (done) {
it('Test 033 : should use a dev version of a dependent plugin if it is already installed', function () {
// Test4 has this dependency in its plugin.xml:
// <dependency id="cordova-plugin-file" url="https://github.com/apache/cordova-plugin-file" />
cordova.create('hello3')
return cordova.create('hello3')
.then(function () {
process.chdir(project);
return cordova.platform('add', 'android', {'fetch': true});
Expand All @@ -153,9 +142,6 @@ describe('end-to-end plugin dependency tests', function () {
.then(function () {
expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
expect(path.join(pluginsDir, 'Test4')).toExist();
}, function (error) {
fail(error);
})
.fin(done);
});
}, TIMEOUT);
});
Loading