Skip to content
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
2 changes: 1 addition & 1 deletion src/yargs-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const options = {
'enable-data-collection-permissions': {
describe: 'Enable data collection permissions support',
type: 'boolean',
default: false,
default: true,
},
};

Expand Down
7 changes: 6 additions & 1 deletion tests/fixtures/webextension_es6_module/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"browser_specific_settings": {
"gecko": {
"id": "@webextension-guid"
"id": "@webextension-guid",
"data_collection_permissions": {
"required": [
"none"
]
}
}
},
"description": "WebExtensions ES module test",
Expand Down
13 changes: 11 additions & 2 deletions tests/fixtures/webextension_with_eslintignore/manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
{
"browser_specific_settings": {
"gecko": {
"id": "@webextension-guid"
"id": "@webextension-guid",
"data_collection_permissions": {
"required": [
"none"
]
}
}
},
"description": "WebExtensions with .eslintignore file",
"manifest_version": 2,
"name": "WebExtensions test",
"permissions": [],
"version": "0.0.1",
"background": { "scripts": ["background.js"] }
"background": {
"scripts": [
"background.js"
]
}
}
3 changes: 3 additions & 0 deletions tests/integration/addons-linter/integration.run.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ describe('Integration/smoke tests', () => {
it('should pass if ran on a simple valid CRX extension', async () => {
const fixture = resolveFixturePath('crx3.crx');
const { exitCode, stderr, stdout } = await executeScript('addons-linter', [
// We disable this because the crx3.crx file doesn't include data
// collection permissions.
'--enable-data-collection-permissions=false',
'-o',
'json',
fixture,
Expand Down
2 changes: 1 addition & 1 deletion tests/test.yargs-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('getDefaultConfigValue()', () => {
expect(getDefaultConfigValue('max-manifest-version')).toEqual(3);
expect(getDefaultConfigValue('disable-xpi-autoclose')).toEqual(false);
expect(getDefaultConfigValue('enable-data-collection-permissions')).toEqual(
false
true
);
});

Expand Down
4 changes: 4 additions & 0 deletions tests/unit/scanners/test.javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ describe('JavaScript Scanner', () => {
it('should support es6 modules', async () => {
const addonLinter = new Linter({
_: ['tests/fixtures/webextension_es6_module'],
// This is needed because the fixtures file has data collection permissions
// and we don't want the `DATA_COLLECTION_PERMISSIONS_PROP_RESERVED` error
// to be emitted.
enableDataCollectionPermissions: true,
});
addonLinter.print = sinon.stub();

Expand Down