Skip to content

Commit ff7217e

Browse files
committed
Clean up tests
1 parent 2ce02fc commit ff7217e

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

spec/linter-lesshint-spec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ describe('The lesshint provider for Linter', () => {
2626

2727
it('fails file that breaks lesshint', () => {
2828
waitsForPromise(() => {
29-
3029
const priorNotificationsCount = atom.notifications.getNotifications().length;
3130

3231
return lint(editor).then(() => {
33-
3432
const notifications = atom.notifications.getNotifications();
3533

3634
expect(notifications[priorNotificationsCount].getType()).toEqual('error');
37-
expect(notifications[priorNotificationsCount].getMessage()).toEqual('lesshint couldn\'t check this file.');
35+
expect(notifications[priorNotificationsCount].getMessage()).toEqual("lesshint couldn't check this file.");
3836
});
3937
});
4038
});
@@ -54,16 +52,13 @@ describe('The lesshint provider for Linter', () => {
5452
});
5553

5654
it('fails file with errors', () => {
57-
const errorName = 'emptyRule';
5855
const errorMessage = "There shouldn't be any empty rules present.";
56+
const errorName = 'emptyRule';
5957

6058
waitsForPromise(() => {
6159
return lint(editor).then((messages) => {
62-
expect(messages[0].type).toBeDefined();
6360
expect(messages[0].type).toEqual('warning');
64-
expect(messages[0].html).toBeDefined();
6561
expect(messages[0].html).toEqual(`<span class='badge badge-flexible'>${errorName}</span> ${errorMessage}`);
66-
expect(messages[0].filePath).toBeDefined();
6762
expect(messages[0].filePath).toMatch(/.+invalid\.less$/);
6863
expect(messages[0].range).toEqual(new Range([1, 0], [1, 4]));
6964
});
@@ -128,14 +123,17 @@ describe('The lesshint provider for Linter', () => {
128123
});
129124
});
130125
});
126+
131127
it('checks with global config when enabled', () => {
132128
atom.config.set('linter-lesshint.globalConfig', true);
129+
133130
waitsForPromise(() => {
134131
return lint(editor).then((messages) => {
135132
expect(messages.length).toEqual(0);
136133
});
137134
});
138135
});
136+
139137
it('does not check with global config when disabled', () => {
140138
atom.config.set('linter-lesshint.globalConfig', false);
141139

@@ -147,8 +145,7 @@ describe('The lesshint provider for Linter', () => {
147145
});
148146
});
149147

150-
151-
describe('valid file', () => {
148+
describe('invalid file', () => {
152149
beforeEach(() => {
153150
waitsForPromise(() => {
154151
return atom.workspace.open(`${__dirname}/fixtures/invalid-global.less`).then((openEditor) => {
@@ -159,14 +156,17 @@ describe('The lesshint provider for Linter', () => {
159156

160157
it('checks with global config when enabled', () => {
161158
atom.config.set('linter-lesshint.globalConfig', true);
159+
162160
waitsForPromise(() => {
163161
return lint(editor).then((messages) => {
164162
expect(messages.length).toEqual(1);
165163
});
166164
});
167165
});
166+
168167
it('does not check with global config when disabled', () => {
169168
atom.config.set('linter-lesshint.globalConfig', false);
169+
170170
waitsForPromise(() => {
171171
return lint(editor).then((messages) => {
172172
expect(messages.length).toEqual(0);

0 commit comments

Comments
 (0)