Skip to content

Commit

Permalink
chore: Change tests placement
Browse files Browse the repository at this point in the history
  • Loading branch information
3y3 committed Aug 14, 2024
1 parent bd8f167 commit a322dc1
Show file tree
Hide file tree
Showing 11 changed files with 4,138 additions and 3,753 deletions.
6 changes: 0 additions & 6 deletions __tests__/.eslintrc.js

This file was deleted.

11 changes: 0 additions & 11 deletions __tests__/tsconfig.json

This file was deleted.

7,825 changes: 4,119 additions & 3,706 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@
},
"license": "MIT",
"devDependencies": {
"@diplodoc/eslint-config": "^2.0.0",
"@diplodoc/lint": "^1.1.2",
"@diplodoc/prettier-config": "^2.0.0",
"@diplodoc/tsconfig": "^1.0.2",
"@es-exec/api": "0.0.5",
"@esbuild-plugins/tsconfig-paths": "^0.1.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,8 @@ import {
} from 'ramda';

import {leftAbbreviation, leftPairsTailAbbreviation, pairAbbreviation} from '../../src/rules';
import {
HEAD,
HEAD_PAIR,
INITIALS,
OTHER,
OTHER_PAIR,
TAIL,
TAIL_PAIR,
} from '../../src/constants/abbreviations';

import {HEAD, HEAD_PAIR, INITIALS, OTHER, OTHER_PAIR, TAIL, TAIL_PAIR} from './abbreviations';

const pairWith =
(a: string) =>
Expand Down
13 changes: 7 additions & 6 deletions __tests__/rules/base.ts → src/constants/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ import {
zip,
} from 'ramda';

import {
BRACKETS_CLOSE_MARKERS,
QUOTATION_CLOSE_MARKERS,
QUOTATION_GENERIC_MARKERS,
SENTENCE_END_MARKERS,
} from '../../src/constants';
import {
rightBracketsClosePrefix,
rightDelimiterPrefix,
Expand All @@ -32,6 +26,13 @@ import {
spaceBothSides,
} from '../../src/rules';

import {
BRACKETS_CLOSE_MARKERS,
QUOTATION_CLOSE_MARKERS,
QUOTATION_GENERIC_MARKERS,
SENTENCE_END_MARKERS,
} from './';

describe('spaceBothSides', () => {
it('evaluates to true if both sides have spaces on their adjacent bounds', () => {
const input = ['left. ', ' right'];
Expand Down
2 changes: 1 addition & 1 deletion __tests__/naive.ts → src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {sentenize} from '../src';
import {sentenize} from './';

describe('sentenize naive', function () {
it('should handle one basic sentence', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/lenses.ts → src/lenses/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {lensIndex, view} from 'ramda';

import {first, second} from '../src/lenses';
import {first, second} from './';

describe('first', () => {
it('creates first element in a array lens', () => {
Expand Down
15 changes: 6 additions & 9 deletions __tests__/parsers.ts → src/parsers/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/* eslint-disable @typescript-eslint/no-shadow */
import {and, compose, equals, filter, map, not, or, reduce, split} from 'ramda';

import {
BRACKETS_CLOSE_MARKERS,
QUOTATION_CLOSE_MARKERS,
QUOTATION_GENERIC_MARKERS,
SENTENCE_END_MARKERS,
} from '../src/constants';
} from '../constants';

import {
bracketsClosePrefix,
delimiterPrefix,
Expand All @@ -27,7 +27,7 @@ import {
spaceSuffix,
spaces,
words,
} from '../src/parsers';
} from './';

describe('fst', () => {
it('should extract first string from string array', () => {
Expand All @@ -37,9 +37,8 @@ describe('fst', () => {
expect(actual).toBe(expected);
});
it('should default to empty string if array is empty', () => {
const input = [];
const expected = '';
const actual = fst(input);
const actual = fst([]);
expect(actual).toBe(expected);
});
});
Expand All @@ -52,9 +51,8 @@ describe('snd', () => {
expect(actual).toBe(expected);
});
it('should default to empty string if array is empty', () => {
const input = [];
const expected = '';
const actual = snd(input);
const actual = snd([]);
expect(actual).toBe(expected);
});
});
Expand Down Expand Up @@ -86,9 +84,8 @@ describe('sentences', () => {
});
it('should default to empty array on empty string', () => {
const input = '';
const expected = [];
const actual = sentences(input);
expect(actual).toStrictEqual(expected);
expect(actual).toStrictEqual([]);
});
});

Expand Down
2 changes: 1 addition & 1 deletion __tests__/rules/initials.ts → src/rules/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {and, compose, map, or, reduce} from 'ramda';

import {leftInitials} from '../../src/rules';
import {leftInitials} from './';

describe('leftInitials', () => {
it('evaluates to true if left is part of the initials', () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/utilities.ts → src/utilities/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
lengthNonZero,
notAlpha,
startsWithLower,
} from '../src/utilities';
} from './';

describe('lenLte', () => {
it('should evaluate to true if array is less than or equal to provided value', () => {
Expand Down

0 comments on commit a322dc1

Please sign in to comment.