Skip to content

Commit 6b44101

Browse files
authored
severity (#570)
1 parent 1cf4987 commit 6b44101

File tree

108 files changed

+303
-201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+303
-201
lines changed

test/unit/NpmPackageJsonLint.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import NpmPackageJsonLint from '../../src/NpmPackageJsonLint';
2+
import {Severity} from '../../../src/types/severity';
23

34
describe('NpmPackageJsonLint Unit Tests', () => {
45
describe('lint method', () => {

test/unit/Reporter.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import chalk from 'chalk';
22
import Reporter from '../../src/Reporter';
3+
import {Severity} from '../../../src/types/severity';
34

45
describe('Reporter Unit Tests', () => {
56
describe('write method', () => {

test/unit/config/applyExtendsIfSpecified.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import applyExtendsIfSpecified from '../../../src/config/applyExtendsIfSpecified';
2+
import {Severity} from '../../../src/types/severity';
23

34
describe('applyExtendsIfSpecified Unit Tests', () => {
45
test('when file has local extends (valid - js), a config object is returned', () => {

test/unit/linter/results-helper.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import resultsHelper from '../../../src/linter/results-helper';
2+
import {Severity} from '../../../src/types/severity';
23

34
describe('resultsHelper Unit Tests', () => {
45
describe('aggregateCountsPerFile', () => {

test/unit/rules/bin-type.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {lint, ruleType} from '../../../src/rules/bin-type';
2+
import {Severity} from '../../../src/types/severity';
23

34
describe('bin-type Unit Tests', () => {
45
describe('a rule type value should be exported', () => {
@@ -12,7 +13,7 @@ describe('bin-type Unit Tests', () => {
1213
const packageJsonData = {
1314
bin: true,
1415
};
15-
const response = lint(packageJsonData, 'error');
16+
const response = lint(packageJsonData, Severity.Error);
1617

1718
expect(response.lintId).toStrictEqual('bin-type');
1819
expect(response.severity).toStrictEqual('error');
@@ -24,7 +25,7 @@ describe('bin-type Unit Tests', () => {
2425
describe('when package.json does not have node', () => {
2526
test('true should be returned', () => {
2627
const packageJsonData = {};
27-
const response = lint(packageJsonData, 'error');
28+
const response = lint(packageJsonData, Severity.Error);
2829

2930
expect(response).toBe(true);
3031
});

test/unit/rules/bundledDependencies-type.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {lint, ruleType} from '../../../src/rules/bundledDependencies-type';
2+
import {Severity} from '../../../src/types/severity';
23

34
describe('bundledDependencies-type Unit Tests', () => {
45
describe('a rule type value should be exported', () => {
@@ -12,7 +13,7 @@ describe('bundledDependencies-type Unit Tests', () => {
1213
const packageJsonData = {
1314
bundledDependencies: 'bundledDependencies',
1415
};
15-
const response = lint(packageJsonData, 'error');
16+
const response = lint(packageJsonData, Severity.Error);
1617

1718
expect(response.lintId).toStrictEqual('bundledDependencies-type');
1819
expect(response.severity).toStrictEqual('error');
@@ -24,7 +25,7 @@ describe('bundledDependencies-type Unit Tests', () => {
2425
describe('when package.json does not have node', () => {
2526
test('true should be returned', () => {
2627
const packageJsonData = {};
27-
const response = lint(packageJsonData, 'error');
28+
const response = lint(packageJsonData, Severity.Error);
2829

2930
expect(response).toBe(true);
3031
});

test/unit/rules/config-type.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {lint, ruleType} from '../../../src/rules/config-type';
2+
import {Severity} from '../../../src/types/severity';
23

34
describe('config-type Unit Tests', () => {
45
describe('a rule type value should be exported', () => {
@@ -12,7 +13,7 @@ describe('config-type Unit Tests', () => {
1213
const packageJsonData = {
1314
config: 'config',
1415
};
15-
const response = lint(packageJsonData, 'error');
16+
const response = lint(packageJsonData, Severity.Error);
1617

1718
expect(response.lintId).toStrictEqual('config-type');
1819
expect(response.severity).toStrictEqual('error');
@@ -24,7 +25,7 @@ describe('config-type Unit Tests', () => {
2425
describe('when package.json does not have node', () => {
2526
test('true should be returned', () => {
2627
const packageJsonData = {};
27-
const response = lint(packageJsonData, 'error');
28+
const response = lint(packageJsonData, Severity.Error);
2829

2930
expect(response).toBe(true);
3031
});

test/unit/rules/cpu-type.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {lint, ruleType} from '../../../src/rules/cpu-type';
2+
import {Severity} from '../../../src/types/severity';
23

34
describe('cpu-type Unit Tests', () => {
45
describe('a rule type value should be exported', () => {
@@ -12,7 +13,7 @@ describe('cpu-type Unit Tests', () => {
1213
const packageJsonData = {
1314
cpu: true,
1415
};
15-
const response = lint(packageJsonData, 'error');
16+
const response = lint(packageJsonData, Severity.Error);
1617

1718
expect(response.lintId).toStrictEqual('cpu-type');
1819
expect(response.severity).toStrictEqual('error');
@@ -24,7 +25,7 @@ describe('cpu-type Unit Tests', () => {
2425
describe('when package.json does not have node', () => {
2526
test('true should be returned', () => {
2627
const packageJsonData = {};
27-
const response = lint(packageJsonData, 'error');
28+
const response = lint(packageJsonData, Severity.Error);
2829

2930
expect(response).toBe(true);
3031
});

test/unit/rules/dependencies-type.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {lint, ruleType} from '../../../src/rules/dependencies-type';
2+
import {Severity} from '../../../src/types/severity';
23

34
describe('dependencies-type Unit Tests', () => {
45
describe('a rule type value should be exported', () => {
@@ -12,7 +13,7 @@ describe('dependencies-type Unit Tests', () => {
1213
const packageJsonData = {
1314
dependencies: 'dependencies',
1415
};
15-
const response = lint(packageJsonData, 'error');
16+
const response = lint(packageJsonData, Severity.Error);
1617

1718
expect(response.lintId).toStrictEqual('dependencies-type');
1819
expect(response.severity).toStrictEqual('error');
@@ -24,7 +25,7 @@ describe('dependencies-type Unit Tests', () => {
2425
describe('when package.json does not have node', () => {
2526
test('true should be returned', () => {
2627
const packageJsonData = {};
27-
const response = lint(packageJsonData, 'error');
28+
const response = lint(packageJsonData, Severity.Error);
2829

2930
expect(response).toBe(true);
3031
});

test/unit/rules/description-format.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {lint, ruleType} from '../../../src/rules/description-format';
2+
import {Severity} from '../../../src/types/severity';
23

34
describe('description-format Unit Tests', () => {
45
describe('a rule type value should be exported', () => {

0 commit comments

Comments
 (0)