Skip to content

Commit

Permalink
test: move files to modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinigami92 committed Jul 29, 2023
1 parent a4631db commit 36bfe6b
Show file tree
Hide file tree
Showing 55 changed files with 87 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module.exports = defineConfig({
},
},
{
files: ['test/*.spec.ts'],
files: ['test/**/*.spec.ts'],
extends: ['plugin:vitest/recommended'],
rules: {
'deprecation/deprecation': 'off',
Expand Down
25 changes: 0 additions & 25 deletions test/__snapshots__/unique.spec.ts.snap

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions test/airline.spec.ts → test/modules/airline.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { Aircraft, faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { Aircraft, faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/animal.spec.ts → test/modules/animal.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/color.spec.ts → test/modules/color.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { CssFunction, CssSpace, faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { CssFunction, CssSpace, faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/commerce.spec.ts → test/modules/commerce.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/company.spec.ts → test/modules/company.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/database.spec.ts → test/modules/database.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/datatype.spec.ts → test/modules/datatype.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker, FakerError } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker, FakerError } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 25;

Expand Down
6 changes: 3 additions & 3 deletions test/date.spec.ts → test/modules/date.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { afterEach, describe, expect, it } from 'vitest';
import { faker, fakerAZ, FakerError } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker, fakerAZ, FakerError } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const converterMap = [
(d: Date) => d,
Expand Down
12 changes: 6 additions & 6 deletions test/finance.spec.ts → test/modules/finance.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import isValidBtcAddress from 'validator/lib/isBtcAddress';
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { FakerError } from '../src/errors/faker-error';
import ibanLib from '../src/modules/finance/iban';
import { luhnCheck } from '../src/modules/helpers/luhn-check';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { FakerError } from '../../src/errors/faker-error';
import ibanLib from '../../src/modules/finance/iban';
import { luhnCheck } from '../../src/modules/helpers/luhn-check';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import validator from 'validator';
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import ibanLib from '../src/modules/finance/iban';
import { times } from './support/times';
import { faker } from '../../src';
import ibanLib from '../../src/modules/finance/iban';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 25;

Expand Down
6 changes: 3 additions & 3 deletions test/git.spec.ts → test/modules/git.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import validator from 'validator';
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/hacker.spec.ts → test/modules/hacker.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
10 changes: 5 additions & 5 deletions test/helpers.spec.ts → test/modules/helpers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it } from 'vitest';
import { faker, FakerError } from '../src';
import { luhnCheck } from '../src/modules/helpers/luhn-check';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import './vitest-extensions';
import { faker, FakerError } from '../../src';
import { luhnCheck } from '../../src/modules/helpers/luhn-check';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';
import './../vitest-extensions';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
4 changes: 2 additions & 2 deletions test/image.spec.ts → test/modules/image.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { seededTests } from './support/seededRuns';
import { faker } from '../../src';
import { seededTests } from './../support/seededRuns';

describe('image', () => {
seededTests(faker, 'image', (t) => {
Expand Down
6 changes: 3 additions & 3 deletions test/internet.spec.ts → test/modules/internet.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import validator from 'validator';
import { describe, expect, it } from 'vitest';
import { allFakers, faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { allFakers, faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/location.spec.ts → test/modules/location.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker, fakerEN_CA, fakerEN_US, FakerError } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker, fakerEN_CA, fakerEN_US, FakerError } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

function degreesToRadians(degrees: number) {
return degrees * (Math.PI / 180.0);
Expand Down
6 changes: 3 additions & 3 deletions test/lorem.spec.ts → test/modules/lorem.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import validator from 'validator';
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/music.spec.ts → test/modules/music.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
4 changes: 2 additions & 2 deletions test/number.spec.ts → test/modules/number.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import validator from 'validator';
import { describe, expect, it } from 'vitest';
import { faker, FakerError } from '../src';
import { seededTests } from './support/seededRuns';
import { faker, FakerError } from '../../src';
import { seededTests } from './../support/seededRuns';

describe('number', () => {
seededTests(faker, 'number', (t) => {
Expand Down
6 changes: 3 additions & 3 deletions test/person.spec.ts → test/modules/person.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker, fakerAZ, fakerMK, fakerUK, Sex } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker, fakerAZ, fakerMK, fakerUK, Sex } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
8 changes: 4 additions & 4 deletions test/phone.spec.ts → test/modules/phone.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { luhnCheck } from '../src/modules/helpers/luhn-check';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { luhnCheck } from '../../src/modules/helpers/luhn-check';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 25;

Expand Down
6 changes: 3 additions & 3 deletions test/random.spec.ts → test/modules/random.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { Faker, faker, FakerError, fakerZH_CN } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { Faker, faker, FakerError, fakerZH_CN } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/science.spec.ts → test/modules/science.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/string.spec.ts → test/modules/string.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker, FakerError } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker, FakerError } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/system.spec.ts → test/modules/system.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import validator from 'validator';
import { describe, expect, it } from 'vitest';
import { faker, fakerSK } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker, fakerSK } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
6 changes: 3 additions & 3 deletions test/vehicle.spec.ts → test/modules/vehicle.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down
8 changes: 4 additions & 4 deletions test/word.spec.ts → test/modules/word.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../src';
import { filterWordListByLength } from '../src/modules/word/filterWordListByLength';
import { seededTests } from './support/seededRuns';
import { times } from './support/times';
import { faker } from '../../src';
import { filterWordListByLength } from '../../src/modules/word/filterWordListByLength';
import { seededTests } from './../support/seededRuns';
import { times } from './../support/times';

const NON_SEEDED_BASED_RUN = 5;

Expand Down

0 comments on commit 36bfe6b

Please sign in to comment.