Skip to content

Commit

Permalink
fix: silence this error that's driving me nuts
Browse files Browse the repository at this point in the history
  • Loading branch information
CGeohagan committed Jul 2, 2024
1 parent 935f156 commit a11b5d6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/data-privacy-compliance.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/data-privacy-compliance.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/frameworks/us_privacy_string_and_api_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class UsPrivacyStringAndAPIGenerator extends FrameworkBase {
let usPrivacyDataString = `${US_PRIVACY_API_VERSION}---`;

if (version !== US_PRIVACY_API_VERSION) {
console.error(`__uspapi: Only able to handle version 1`);
this.log(`__uspapi error: Only able to handle version 1`);
canSuccessfullyAnswer = false;
}

Expand All @@ -68,7 +68,7 @@ class UsPrivacyStringAndAPIGenerator extends FrameworkBase {
break;
default:
canSuccessfullyAnswer = false;
console.error(`__uspapi: Unable to handle command '${command}'`);
this.log(`__uspapi error: Unable to handle command '${command}'`);
}

this.log(
Expand Down
2 changes: 0 additions & 2 deletions test/us_privacy_string_and_api_generator.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,10 @@ describe('USPrivacyAPI', () => {
addFakeCCPAFramework();

let success;
let consoleError = jest.spyOn(console, 'error').mockImplementation(() => {});

window.__uspapi('getUSPData', 2, (_, wasSuccess) => {
success = wasSuccess;
});
expect(consoleError).toHaveBeenCalled();
expect(success).toBe(false);
});

Expand Down

0 comments on commit a11b5d6

Please sign in to comment.