This repository has been archived by the owner on Aug 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from AtomLinter/arcanemagus/update-ci
General fixes: * Update to ESLint v4.5.0 * Update to `eslint-config-airbnb-base` v11.3.2 * Update to `eslint-plugin-import` v2.7.0 * Asyncify the specs with `jasmine-fix` * Defer dependency loading and package dependency checking to speed up activation time Update the Travis CI configuration: * Update to Ruby 2.4.1 * Use Trusty based images * Update APT package dependencies
- Loading branch information
Showing
5 changed files
with
110 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
module.exports = { | ||
env: { | ||
jasmine: true, | ||
atomtest: true, | ||
jasmine: true | ||
}, | ||
rules: { | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
"devDependencies": true | ||
} | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,39 @@ | ||
'use babel'; | ||
|
||
import * as path from 'path'; | ||
// eslint-disable-next-line no-unused-vars | ||
import { it, fit, wait, beforeEach, afterEach } from 'jasmine-fix'; | ||
|
||
const lint = require('../lib/linter-reek.js').provideLinter().lint; | ||
|
||
const goodFile = path.join(__dirname, 'fixtures', 'good.rb'); | ||
const badFile = path.join(__dirname, 'fixtures', 'bad.rb'); | ||
|
||
describe('The reek provider for Linter', () => { | ||
beforeEach(() => { | ||
beforeEach(async () => { | ||
atom.workspace.destroyActivePaneItem(); | ||
waitsForPromise(() => | ||
Promise.all([ | ||
atom.packages.activatePackage('linter-reek'), | ||
atom.packages.activatePackage('language-ruby'), | ||
]).then(() => | ||
atom.workspace.open(goodFile), | ||
), | ||
); | ||
await atom.packages.activatePackage('language-ruby'); | ||
await atom.packages.activatePackage('linter-reek'); | ||
}); | ||
|
||
describe('checks a file with issues and', () => { | ||
let editor = null; | ||
beforeEach(() => { | ||
waitsForPromise(() => | ||
atom.workspace.open(badFile).then(openEditor => (editor = openEditor)), | ||
); | ||
}); | ||
|
||
it('finds at least one message', () => { | ||
waitsForPromise(() => | ||
lint(editor).then(messages => | ||
expect(messages.length).toBeGreaterThan(0), | ||
), | ||
); | ||
}); | ||
|
||
it('verifies the first message', () => { | ||
const messageHtml = 'IrresponsibleModule: Dirty has no descriptive comment ' + | ||
'[<a href="https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md">Irresponsible-Module</a>]'; | ||
waitsForPromise(() => | ||
lint(editor).then((messages) => { | ||
expect(messages[0].type).toEqual('Warning'); | ||
expect(messages[0].severity).toEqual('warning'); | ||
expect(messages[0].text).not.toBeDefined(); | ||
expect(messages[0].html).toEqual(messageHtml); | ||
expect(messages[0].filePath).toBe(badFile); | ||
expect(messages[0].range).toEqual([[0, 0], [0, 11]]); | ||
}), | ||
); | ||
}); | ||
it('checks a file with issues and reports the correct message', async () => { | ||
const messageHtml = 'IrresponsibleModule: Dirty has no descriptive comment ' + | ||
'[<a href="https://github.com/troessner/reek/blob/master/docs/Irresponsible-Module.md">Irresponsible-Module</a>]'; | ||
const editor = await atom.workspace.open(badFile); | ||
const messages = await lint(editor); | ||
|
||
expect(messages.length).toBe(1); | ||
expect(messages[0].type).toEqual('Warning'); | ||
expect(messages[0].severity).toEqual('warning'); | ||
expect(messages[0].text).not.toBeDefined(); | ||
expect(messages[0].html).toEqual(messageHtml); | ||
expect(messages[0].filePath).toBe(badFile); | ||
expect(messages[0].range).toEqual([[0, 0], [0, 11]]); | ||
}); | ||
|
||
it('finds nothing wrong with a valid file', () => { | ||
waitsForPromise(() => | ||
atom.workspace.open(goodFile).then(editor => | ||
lint(editor).then(messages => | ||
expect(messages.length).toBe(0), | ||
), | ||
), | ||
); | ||
it('finds nothing wrong with a valid file', async () => { | ||
const editor = await atom.workspace.open(goodFile); | ||
const messages = await lint(editor); | ||
expect(messages.length).toBe(0); | ||
}); | ||
}); |