Skip to content
Permalink
Browse files
chore: bump cordova-eslint w/ automatic fixes (#848)
  • Loading branch information
erisu committed Jul 16, 2020
1 parent 784f6b4 commit 05dc359da0ad8c2ab913e2e8547868df13815863
Showing 11 changed files with 138 additions and 177 deletions.
@@ -69,7 +69,7 @@ describe('end-to-end plugin dependency tests', function () {
return cordova.plugin('add', 'cordova-plugin-file');
}).then(function () {
expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
return cordova.plugin('add', plugins['Test1']);
return cordova.plugin('add', plugins.Test1);
}).catch(function (err) {
expect(err.message).toContain('does not satisfy dependency plugin requirement');
});
@@ -82,7 +82,7 @@ describe('end-to-end plugin dependency tests', function () {
})
.then(function () {
expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
return cordova.plugin('add', plugins['Test1'], { force: true });
return cordova.plugin('add', plugins.Test1, { force: true });
})
.then(function () {
expect(path.join(pluginsDir, 'Test1')).toExist();
@@ -97,7 +97,7 @@ describe('end-to-end plugin dependency tests', function () {
})
.then(function () {
expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
return cordova.plugin('add', plugins['Test1']);
return cordova.plugin('add', plugins.Test1);
})
.then(function () {
expect(path.join(pluginsDir, 'Test1')).toExist();
@@ -109,15 +109,15 @@ describe('end-to-end plugin dependency tests', function () {
// Test1 and Test3 have incompatible dependencies on cordova-plugin-file
return Promise.resolve()
.then(function () {
return cordova.plugin('add', plugins['Test1']);
return cordova.plugin('add', plugins.Test1);
})
.then(function () {
expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
expect(path.join(pluginsDir, 'Test1')).toExist();
return cordova.plugin('add', plugins['Test2']);
return cordova.plugin('add', plugins.Test2);
})
.then(function () {
return cordova.plugin('add', plugins['Test3']);
return cordova.plugin('add', plugins.Test3);
})
.catch(function (err) {
expect(path.join(pluginsDir, 'Test2')).toExist();
@@ -134,7 +134,7 @@ describe('end-to-end plugin dependency tests', function () {
return cordova.plugin('add', 'https://github.com/apache/cordova-plugin-file');
})
.then(function () {
return cordova.plugin('add', plugins['Test4']);
return cordova.plugin('add', plugins.Test4);
})
.then(function () {
expect(path.join(pluginsDir, 'cordova-plugin-file')).toExist();
@@ -89,20 +89,24 @@ describe('pkgJson', function () {
}

const customMatchers = {
toSatisfy: () => ({ compare (version, spec) {
const pass = semver.satisfies(version, spec);
const expectation = (pass ? 'not ' : '') + 'to satisfy';
return {
pass, message: `expected ${version} ${expectation} ${spec}`
};
} }),
tohaveMinSatisfyingVersion: () => ({ compare (spec, version) {
const pass = specWithMinSatisfyingVersion(version).asymmetricMatch(spec);
const expectation = (pass ? 'not ' : '') + 'to have minimal satisfying version';
return {
pass, message: `expected ${spec} ${expectation} ${version}`
};
} })
toSatisfy: () => ({
compare (version, spec) {
const pass = semver.satisfies(version, spec);
const expectation = (pass ? 'not ' : '') + 'to satisfy';
return {
pass, message: `expected ${version} ${expectation} ${spec}`
};
}
}),
tohaveMinSatisfyingVersion: () => ({
compare (spec, version) {
const pass = specWithMinSatisfyingVersion(version).asymmetricMatch(spec);
const expectation = (pass ? 'not ' : '') + 'to have minimal satisfying version';
return {
pass, message: `expected ${spec} ${expectation} ${version}`
};
}
})
};

// Add our custom matchers
@@ -59,15 +59,15 @@ describe('plugman/uninstall', () => {
.then(function () {
return install('android', project1, plugins['org.test.plugins.dummyplugin']);
}).then(function () {
return install('android', project1, plugins['A']);
return install('android', project1, plugins.A);
}).then(function () {
return install('android', project2, plugins['C']);
return install('android', project2, plugins.C);
}).then(function () {
return install('android', project2, plugins['A']);
return install('android', project2, plugins.A);
}).then(function () {
return install('android', project3, plugins['A']);
return install('android', project3, plugins.A);
}).then(function () {
return install('android', project3, plugins['C']);
return install('android', project3, plugins.C);
}).then(function (result) {
expect(result).toEqual(true);
});
@@ -264,12 +264,12 @@ describe('plugman/uninstall', () => {
return uninstall('android', project, plugins['org.test.plugins.dummyplugin'])
.then(function () {
// Fails... A depends on
return uninstall('android', project, plugins['C']);
return uninstall('android', project, plugins.C);
}).catch(function (err) {
expect(err.stack).toMatch(/The plugin 'C' is required by \(A\), skipping uninstallation./);
}).then(function () {
// dependencies on C,D ... should this only work with --recursive? prompt user..?
return uninstall('android', project, plugins['A']);
return uninstall('android', project, plugins.A);
});
});
});

0 comments on commit 05dc359

Please sign in to comment.