Skip to content

Commit

Permalink
test: spy on semver.satisfies to remove the need to have the actual c…
Browse files Browse the repository at this point in the history
…orrect java version installed
  • Loading branch information
breautek committed May 9, 2021
1 parent bfc6385 commit fef832d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/unit/check_reqs.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ var path = require('path');
var events = require('cordova-common').events;
var which = require('which');
const { CordovaError } = require('cordova-common');
const semver = require('semver');

// This should match /bin/templates/project/build.gradle
const DEFAULT_TARGET_API = 30;
Expand Down Expand Up @@ -67,6 +68,7 @@ describe('check_reqs', function () {
});

it('should return the correct version if javac prints _JAVA_OPTIONS', async () => {
spyOn(semver, 'satisfies').and.returnValue(true);
check_reqs.__set__({
java: {
getVersion: async () => {
Expand Down

0 comments on commit fef832d

Please sign in to comment.