diff --git a/package.json b/package.json index b25c94c..c994f0d 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "engines": { "atom": ">=1.9.0 <2.0.0" }, + "activationHooks": ["language-python:grammar-used"], "configSchema": { "executablePath": { "type": "string", diff --git a/spec/linter-flake8-spec.js b/spec/linter-flake8-spec.js index b76419a..0c392cb 100644 --- a/spec/linter-flake8-spec.js +++ b/spec/linter-flake8-spec.js @@ -12,14 +12,17 @@ describe('The flake8 provider for Linter', () => { const lint = require('../lib/main.js').provideLinter().lint; beforeEach(() => { + // Info about this beforeEach() implementation: + // https://github.com/AtomLinter/Meta/issues/15 + const activationPromise = + atom.packages.activatePackage('linter-flake8'); + waitsForPromise(() => - Promise.all([ - atom.packages.activatePackage('linter-flake8'), - atom.packages.activatePackage('language-python'), - ]).then(() => - atom.workspace.open(goodPath) - ) - ); + atom.packages.activatePackage('language-python').then(() => + atom.workspace.open(goodPath))); + + atom.packages.triggerDeferredActivationHooks(); + waitsForPromise(() => activationPromise); }); it('should be in the packages list', () =>