test: add spec files for all 15 library modules (closes #7)#97
Merged
Conversation
Create co-located spec files covering validator, pipe, and directive for each module: cpf, cnpj, cep, rg, telefone, celular, inscricaoestadual, currency, number, percentage, pispasep, placa, renavam, time, titulo. Fix test infrastructure to run with Angular 19: - Remove deprecated main:test.ts entry; use built-in Angular 19 discovery - Add include patterns in angular.json for library spec files - Load zone.js + zone.js/testing via karma files for correct order - Replace removed karma-coverage-istanbul-reporter with karma-coverage - Update tsconfig.spec.json to compile library specs - Fix demo.component.ts: remove fakerBr (removed from js-brasil 2.7.1) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace static seed values in generate() with live generators that produce valid CPF, CNPJ, CEP, RG, Telefone, Placa, Renavam, PIS/PASEP, Título, Time, and Currency using inline check-digit algorithms. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Bump js-brasil to 2.8.0 which ships the new fakerBr module, then replace the ~90 lines of inline check-digit generators in demo.component.ts with direct calls to fakerBr. The algorithm now lives in one tested place (js-brasil) instead of being duplicated in the demo. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What changed
New spec files (15):
ng-brazil/src/<module>/<module>.spec.ts— one per module, co-located with sourceInfrastructure fixes:
angular.json— remove deprecatedmain: src/test.ts; addincludepatterns for library spec discovery; use Angular 19 built-in test entrykarma.conf.js— replace removedkarma-coverage-istanbul-reporterwithkarma-coverage; addzone.js+zone.js/testingas karma script files for correct load order (zone.js → jasmine → zone.js/testing)src/tsconfig.spec.json— add../ng-brazil/src/**/*.spec.tsto include so library specs are compiledsrc/app/demo/demo.component.ts— removefakerBrimport (removed from js-brasil 2.7.1)Test plan
npm run testdemo -- --watch=false --browsers=ChromeHeadless→ 75 SUCCESS, 0 FAILED🤖 Generated with Claude Code