Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence this error that's driving me nuts #34

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading