Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
coditva committed Mar 28, 2024
1 parent 1e8855b commit 4246d89
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
6 changes: 4 additions & 2 deletions lib/sandbox/postman-legacy-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,8 @@ module.exports = {
// used a lot.
if (key === 'postman') {
scope.__postman_legacy_api_usage.add('postman.setNextRequest');
} else {
}
else {
scope.__postman_legacy_api_usage.add(key);
}

Expand Down Expand Up @@ -480,7 +481,8 @@ module.exports = {
scope.__postman_legacy_api_usage.forEach((key) => {
if (LEGACY_GLOBS_ALTERNATIVES[key]) {
console.warn(`Using "${key}" is deprecated. Use "${LEGACY_GLOBS_ALTERNATIVES[key]}" instead.`);
} else if (LEGACY_GLOBS.includes(key)) {
}
else if (LEGACY_GLOBS.includes(key)) {
console.warn(`Using "${key}" is deprecated.`);
}
});
Expand Down
13 changes: 9 additions & 4 deletions test/unit/sandbox-libraries/legacy.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ describe('sandbox library - legacy', function () {

expect(consoleSpy).to.be.calledOnce;
expect(consoleSpy.firstCall.args[1]).to.equal('warn');
expect(consoleSpy.firstCall.args[2]).to.equal('Using "data" is deprecated. Use "pm.iterationData" instead.');
expect(consoleSpy.firstCall.args[2])
.to.equal('Using "data" is deprecated. Use "pm.iterationData" instead.');
done();
});
});
Expand All @@ -62,7 +63,8 @@ describe('sandbox library - legacy', function () {

expect(consoleSpy).to.be.calledOnce;
expect(consoleSpy.firstCall.args[1]).to.equal('warn');
expect(consoleSpy.firstCall.args[2]).to.equal('Using "atob" is deprecated. Use "require(\'atob\')" instead.');
expect(consoleSpy.firstCall.args[2])
.to.equal('Using "atob" is deprecated. Use "require(\'atob\')" instead.');
done();
});
});
Expand All @@ -82,9 +84,12 @@ describe('sandbox library - legacy', function () {

expect(consoleSpy).to.be.calledTwice;
expect(consoleSpy.firstCall.args[1]).to.equal('warn');
expect(consoleSpy.firstCall.args[2]).to.equal('Using "data" is deprecated. Use "pm.iterationData" instead.');
expect(consoleSpy.firstCall.args[2])
.to.equal('Using "data" is deprecated. Use "pm.iterationData" instead.');

expect(consoleSpy.secondCall.args[1]).to.equal('warn');
expect(consoleSpy.secondCall.args[2]).to.equal('Using "environment" is deprecated. Use "pm.environment" instead.');
expect(consoleSpy.secondCall.args[2])
.to.equal('Using "environment" is deprecated. Use "pm.environment" instead.');
done();
});
});
Expand Down

0 comments on commit 4246d89

Please sign in to comment.