Skip to content

Commit

Permalink
feat: updated most paths in tests to lib
Browse files Browse the repository at this point in the history
  • Loading branch information
prisis committed Jan 21, 2022
1 parent ba3697b commit 228fa50
Show file tree
Hide file tree
Showing 27 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
],
"scripts": {
"preinstall": "npx only-allow pnpm",
"build": "microbundle --compress --strict --raw",
"build": "microbundle --strict --raw",
"browser": "gulp browser",
"docs:build": "vitepress build docs",
"docs:build:ci": "run-s build browser docs:build",
Expand Down
2 changes: 1 addition & 1 deletion test/address.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { JestMockCompat } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('address', () => {
describe('city()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/all_functional.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

const IGNORED_MODULES = [
'locales',
Expand Down
2 changes: 1 addition & 1 deletion test/animal.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('animal', () => {
describe('dog()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/commerce.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('commerce', () => {
describe('color()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/company.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('company', () => {
describe('companyName()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/database.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('database', () => {
describe('column()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/datatype.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('datatype', () => {
describe('number', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/date.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('date', () => {
describe('past()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/fake.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('fake', () => {
describe('fake()', () => {
Expand Down
6 changes: 3 additions & 3 deletions test/finance.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { JestMockCompat } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';
import { luhnCheck } from './support/luhnCheck';

faker.seed(1234);
Expand Down Expand Up @@ -383,7 +383,7 @@ describe('finance', () => {
});

describe('iban()', () => {
const ibanLib = require('../lib/iban').default;
const ibanLib = require('../dist/faker/iban').default;
it('returns a random yet formally correct IBAN number', () => {
const iban =
// @ts-expect-error
Expand Down Expand Up @@ -414,7 +414,7 @@ describe('finance', () => {
});

describe('bic()', () => {
const ibanLib = require('../lib/iban').default;
const ibanLib = require('../dist/faker/iban').default;
it('returns a random yet formally correct BIC number', () => {
const bic = faker.finance.bic();
const expr = new RegExp(
Expand Down
10 changes: 5 additions & 5 deletions test/finance_iban.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect } from 'vitest';
import { describe, it } from 'vitest';
import { faker } from '../lib';
import ibanLib from '../lib/iban';
import { faker } from '../dist/faker';
import ibanLib from '../dist/faker/iban';

function getAnIbanByCountry(countryCode) {
let iban =
Expand Down Expand Up @@ -99,7 +99,7 @@ describe('finance_iban.js', () => {
// Account Code 16 digits
// Total Length 24 chars

const ibanLib = require('../lib/iban').default;
const ibanLib = require('../dist/faker/iban').default;

it('IBAN for Pakistan is correct', () => {
faker.seed(28);
Expand Down Expand Up @@ -163,7 +163,7 @@ describe('finance_iban.js', () => {
// Chiffre d'indicatif national 0
// Numéro de compte bancaire 0519786457841326

const ibanLib = require('../lib/iban').default;
const ibanLib = require('../dist/faker/iban').default;

it('IBAN for Turkish is correct', () => {
faker.seed(37);
Expand Down Expand Up @@ -236,7 +236,7 @@ describe('finance_iban.js', () => {

// example IBAN AZ21 NABZ 0000 0000 1370 1000 1944

const ibanLib = require('../lib/iban').default;
const ibanLib = require('../dist/faker/iban').default;

it('IBAN for Azerbaijan is correct', () => {
faker.seed(21);
Expand Down
2 changes: 1 addition & 1 deletion test/git.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { JestMockCompat } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('git.js', () => {
describe('branch()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';
import { luhnCheck } from './support/luhnCheck';

describe('helpers.js', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/image.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('image', () => {
describe('lorempicsum', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/internet.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('internet.js', () => {
describe('email()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/locales.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

// Remark: actual use of locales functionality is currently tested in all.functional.js test

Expand Down
2 changes: 1 addition & 1 deletion test/lorem.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { JestMockCompat } from 'vitest';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('lorem.js', () => {
describe('word()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/music.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

faker.seed(1234);

Expand Down
2 changes: 1 addition & 1 deletion test/name.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

function assertInArray<T>(value: T, array: readonly T[]): void {
const idx = array.indexOf(value);
Expand Down
2 changes: 1 addition & 1 deletion test/phone_number.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('phone_number.js', () => {
describe('phoneNumber()', () => {
Expand Down
4 changes: 2 additions & 2 deletions test/random.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { Mersenne } from '../lib/mersenne';
import { faker } from '../dist/faker';
import { Mersenne } from '../dist/faker/mersenne';

const mersenne = new Mersenne();

Expand Down
2 changes: 1 addition & 1 deletion test/system.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('system', () => {
describe('directoryPath()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/time.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

faker.seed(1234);

Expand Down
2 changes: 1 addition & 1 deletion test/unique.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('unique', () => {
describe('unique()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/vehicle.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'vitest';
import { describe, it, vi } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('vehicle', () => {
describe('vehicle()', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/word.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { faker } from '../lib';
import { faker } from '../dist/faker';

describe('word', () => {
const methods = [
Expand Down

0 comments on commit 228fa50

Please sign in to comment.