Skip to content

Commit

Permalink
blacklist => denylist
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffposnick committed Feb 2, 2021
1 parent 46cccfc commit 945bec7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions src/browser-models/local-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class LocalBrowser extends Browser {
* @param {DriverConfig} config The config for the browser.
* @param {String} release Release name of the browser, must be 'stable',
* 'beta' or 'unstable'.
* @param {Object} blacklist This is a list of browser versions => driver
* versions which is used to blacklist a browser from be made available. This
* @param {Object} denylist This is a list of browser versions => driver
* versions which is used to deny a browser from being made available. This
* is not assurance of a browser working but may be used more actively
* to block bad browser support in the future.
*/
constructor(config, release, blacklist) {
constructor(config, release, denylist) {
super(config);

if (typeof config._prettyName !== 'string' ||
Expand All @@ -57,7 +57,7 @@ class LocalBrowser extends Browser {
}

this._release = release;
this._blacklist = blacklist;
this._denylist = denylist;
}

/**
Expand Down Expand Up @@ -85,7 +85,7 @@ class LocalBrowser extends Browser {
}
}

if (this.isBlackListed()) {
if (this.isDenyListed()) {
return false;
}

Expand All @@ -101,13 +101,13 @@ class LocalBrowser extends Browser {
* This method is largely used internally to determine if a browser should
* be made available or not.
*
* This method will only blacklist a browser if there is a known bad browser
* This method will only denylist a browser if there is a known bad browser
* + driver module combination.
*
* @return {Boolean} Whether this browser is blacklisted or not from being
* @return {Boolean} Whether this browser is denylisted or not from being
* included in available browsers.
*/
isBlackListed() {
isDenyListed() {
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions test/browser-usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ describe('Test Usage of Browsers', function() {
function setupTest(localBrowser) {
describe(`Test Usage of ${localBrowser.getPrettyName()}`, function() {
it(`should be able to use ${localBrowser.getId()} - ${localBrowser.getReleaseName()}`, function() {
if (localBrowser.isBlackListed()) {
console.warn(`Browser is blacklisted ${localBrowser.getId()} - ${localBrowser.getReleaseName()}`);
if (localBrowser.isDenyListed()) {
console.warn(`Browser is denylisted ${localBrowser.getId()} - ${localBrowser.getReleaseName()}`);
return;
}

Expand Down
10 changes: 5 additions & 5 deletions test/local-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('LocalBrowser', function() {
_prettyName: 'Example Pretty Name',
};

const EXAMPLE_BLACKLIST = {
const EXAMPLE_DENYLIST = {
999: '1.0.0',
};

Expand All @@ -59,7 +59,7 @@ describe('LocalBrowser', function() {
new LocalBrowser(
EXAMPLE_CONFIG,
'stable',
EXAMPLE_BLACKLIST
EXAMPLE_DENYLIST
);
});

Expand All @@ -71,7 +71,7 @@ describe('LocalBrowser', function() {
new LocalBrowser(
options,
'stable',
EXAMPLE_BLACKLIST
EXAMPLE_DENYLIST
);
}).to.throw('Invalid prettyName');
});
Expand All @@ -84,7 +84,7 @@ describe('LocalBrowser', function() {
new LocalBrowser(
options,
'stable',
EXAMPLE_BLACKLIST
EXAMPLE_DENYLIST
);
}).to.throw('Invalid prettyName');
});
Expand Down Expand Up @@ -296,5 +296,5 @@ describe('LocalBrowser', function() {
});
});

// TODO Blacklist test
// TODO denylist test
});

0 comments on commit 945bec7

Please sign in to comment.