Skip to content

Commit

Permalink
fix: add tests folder
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan committed May 14, 2024
1 parent 62df982 commit c6cc7df
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 0 additions & 1 deletion packages/typescript/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ node_modules/
dist/
types/
coverage/
tests/
13 changes: 13 additions & 0 deletions packages/typescript/tests/cnpjGenerator.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import cnpjGenerator from '../src/cnpjGenerator'
import { cnpjIsValid } from 'multiform-validator'

describe('geraEValida', () => {
it('should generate a valid CNPJ', () => {

expect(cnpjIsValid(cnpjGenerator()).isValid).toBe(true); // Assert that the generated CNPJ is valid
});

it('Should generate a valid cnpj and return a string', () => {
expect(typeof cnpjGenerator()).toBe('string'); // Assert that the generated CNPJ is a string
});
});
13 changes: 13 additions & 0 deletions packages/typescript/tests/cpfGenerator.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import cpfGenerator from '../src/cpfGenerator'
import { cpfIsValid } from 'multiform-validator'

describe('geraEValida', () => {
it('should generate a valid CPF', () => {

expect(cpfIsValid(cpfGenerator()).isValid).toBe(true); // Assert that the generated CPF is valid
});

it('Should generate a valid cpf and return a string', () => {
expect(typeof cpfGenerator()).toBe('string'); // Assert that the generated CPF is a string
});
});

0 comments on commit c6cc7df

Please sign in to comment.