Skip to content

Commit

Permalink
chore: test files prefixed with a _ are helpers, not tests
Browse files Browse the repository at this point in the history
This commit changes jest.config.js file so that test files that starts with `_`
 - won't be considered as a jest test file
 - won't trigger a 'Your test suite must contain at least one test.' failure
  • Loading branch information
nulltoken committed Mar 21, 2020
1 parent 74b3907 commit 6047c04
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
preset: 'ts-jest',
moduleFileExtensions: ['ts', 'tsx', 'js'],
testEnvironment: 'node',
testMatch: ['<rootDir>/src/**/__tests__/*.(ts)'],
testMatch: ['<rootDir>/src/**/__tests__/!(_)*.(ts)'],
testPathIgnorePatterns: ['/node_modules/', '\.karma\.test\.ts$'],
coveragePathIgnorePatterns: ['<rootDir>/dist/', '/node_modules/'],
setupFilesAfterEnv: ['./setupJest.ts', './setupTests.ts']
Expand Down
2 changes: 1 addition & 1 deletion src/rulesets/oas/__tests__/oas2-parameter-description.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DiagnosticSeverity } from '@stoplight/types';
import { RuleType, Spectral } from '../../../spectral';
import testParameterDescription from '../../__tests__/shared/_parameter-description';
import testParameterDescription from '../../__tests__/shared/parameter-description';
import * as ruleset from '../index.json';

describe('oas2-parameter-description', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/rulesets/oas/__tests__/oas3-parameter-description.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DiagnosticSeverity } from '@stoplight/types';
import { RuleType, Spectral } from '../../../spectral';
import testParameterDescription from '../../__tests__/shared/_parameter-description';
import testParameterDescription from '../../__tests__/shared/parameter-description';
import * as ruleset from '../index.json';

describe('oas3-parameter-description', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import testRule from './templates/_schema-example';
import testRule from './templates/schema-example';

const ruleName = 'oas3-valid-content-schema-example';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import testRule from './templates/_schema-example';
import testRule from './templates/schema-example';

const ruleName = 'oas3-valid-header-schema-example';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import testRule from './templates/_oas-example';
import testRule from './templates/oas-example';

const ruleName = 'oas3-valid-oas-content-example';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import testRule from './templates/_oas-example';
import testRule from './templates/oas-example';

const ruleName = 'oas3-valid-oas-header-example';

Expand Down

0 comments on commit 6047c04

Please sign in to comment.