diff --git a/package.json b/package.json index 7d84232..53ec620 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "engines": { "atom": ">=1.0.0 <2.0.0" }, + "activationHooks": ["language-coffee-script:grammar-used"], "package-deps": [ "linter" ], diff --git a/spec/linter-coffeelint-spec.js b/spec/linter-coffeelint-spec.js index fce6492..6bceaf9 100644 --- a/spec/linter-coffeelint-spec.js +++ b/spec/linter-coffeelint-spec.js @@ -9,12 +9,17 @@ const lint = require('../lib/init.coffee').provideLinter().lint; describe('The CoffeeLint provider for Linter', () => { describe('works with CoffeeScript files and', () => { beforeEach(() => { + // Info about this beforeEach() implementation: + // https://github.com/AtomLinter/Meta/issues/15 + const activationPromise = + atom.packages.activatePackage('linter-coffeelint'); + waitsForPromise(() => - Promise.all([ - atom.packages.activatePackage('linter-coffeelint'), - atom.packages.activatePackage('language-coffee-script'), - ]) - ); + atom.packages.activatePackage('language-coffee-script').then(() => + atom.workspace.open(validPath))); + + atom.packages.triggerDeferredActivationHooks(); + waitsForPromise(() => activationPromise); }); it('finds nothing wrong with a valid file', () => {