Skip to content

Commit

Permalink
Keep raw object around, alias to module directly, but drop in a dep…
Browse files Browse the repository at this point in the history
…recation warning if it is used. Update all code and specs to stop using the `raw` object.
  • Loading branch information
filmaj committed Jun 12, 2017
1 parent 3712061 commit 90b6857
Show file tree
Hide file tree
Showing 30 changed files with 352 additions and 354 deletions.
42 changes: 21 additions & 21 deletions integration-tests/fetch.spec.js
Expand Up @@ -49,33 +49,33 @@ describe('end-to-end plugin dependency tests', function() {
});

it('Test 029 : should fail if dependency already installed is wrong version', function(done) {
cordova.raw.create('hello3')
cordova.create('hello3')
.then(function() {
process.chdir(project);
return cordova.raw.platform('add', 'android', {'fetch': true});
return cordova.platform('add', 'android', {'fetch': true});
}).then(function() {
return cordova.raw.plugin('add', 'cordova-plugin-file', {'fetch': true});
return cordova.plugin('add', 'cordova-plugin-file', {'fetch': true});
}).then(function() {
expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
return cordova.raw.plugin('add', plugins['Test1'], {'fetch': true});
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.raw.create('hello3')
cordova.create('hello3')
.then(function() {
process.chdir(project);
return cordova.raw.platform('add', 'android', {'fetch': true});
return cordova.platform('add', 'android', {'fetch': true});
})
.then(function() {
return cordova.raw.plugin('add', 'cordova-plugin-file', {'fetch': true});
return cordova.plugin('add', 'cordova-plugin-file', {'fetch': true});
})
.then(function() {
expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
return cordova.raw.plugin('add', plugins['Test1'], {'fetch': true, 'force':true});
return cordova.plugin('add', plugins['Test1'], {'fetch': true, 'force':true});
})
.then(function() {
expect(path.join(pluginsDir, 'Test1')).toExist();
Expand All @@ -89,17 +89,17 @@ describe('end-to-end plugin dependency tests', function() {

it('Test 031 : should pass if dependency already installed is same major version (if specific version is specified)', function(done) {
//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.raw.create('hello3')
cordova.create('hello3')
.then(function() {
process.chdir(project);
return cordova.raw.platform('add', 'android', {'fetch': true});
return cordova.platform('add', 'android', {'fetch': true});
})
.then(function() {
return cordova.raw.plugin('add', 'cordova-plugin-file@2.1.0', {'fetch': true});
return cordova.plugin('add', 'cordova-plugin-file@2.1.0', {'fetch': true});
})
.then(function() {
expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
return cordova.raw.plugin('add', plugins['Test1'], {'fetch': true});
return cordova.plugin('add', plugins['Test1'], {'fetch': true});
})
.then(function() {
expect(path.join(pluginsDir, 'Test1')).toExist();
Expand All @@ -114,21 +114,21 @@ describe('end-to-end plugin dependency tests', function() {
it('Test 032 : should handle two plugins with same dependent plugin', function(done) {
//Test1 and Test2 have compatible dependencies on cordova-plugin-file
//Test1 and Test3 have incompatible dependencies on cordova-plugin-file
cordova.raw.create('hello3')
cordova.create('hello3')
.then(function() {
process.chdir(project);
return cordova.raw.platform('add', 'android', {'fetch': true});
return cordova.platform('add', 'android', {'fetch': true});
})
.then(function() {
return cordova.raw.plugin('add', plugins['Test1'], {'fetch': true});
return cordova.plugin('add', plugins['Test1'], {'fetch': true});
})
.then(function() {
expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
expect(path.join(pluginsDir, 'Test1')).toExist();
return cordova.raw.plugin('add', plugins['Test2'], {'fetch': true});
return cordova.plugin('add', plugins['Test2'], {'fetch': true});
})
.then(function() {
return cordova.raw.plugin('add', plugins['Test3'], {'fetch': true});
return cordova.plugin('add', plugins['Test3'], {'fetch': true});
})
.fail(function(err) {
expect(path.join(pluginsDir, 'Test2')).toExist();
Expand All @@ -141,16 +141,16 @@ describe('end-to-end plugin dependency tests', function() {
it('Test 033 : should use a dev version of a dependent plugin if it is already installed', function(done) {
//Test4 has this dependency in its plugin.xml:
//<dependency id="cordova-plugin-file" url="https://github.com/apache/cordova-plugin-file" />
cordova.raw.create('hello3')
cordova.create('hello3')
.then(function() {
process.chdir(project);
return cordova.raw.platform('add', 'android', {'fetch': true});
return cordova.platform('add', 'android', {'fetch': true});
})
.then(function() {
return cordova.raw.plugin('add', 'https://github.com/apache/cordova-plugin-file');
return cordova.plugin('add', 'https://github.com/apache/cordova-plugin-file');
})
.then(function() {
return cordova.raw.plugin('add', plugins['Test4'], {'fetch': true});
return cordova.plugin('add', plugins['Test4'], {'fetch': true});
})
.then(function() {
expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
Expand Down

0 comments on commit 90b6857

Please sign in to comment.