sigo-entities 1.2.552 → 1.2.554

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +0,0 @@
1
- // Prueba sobre el build (dist): correr `npm run build` antes de `npm test`
2
- import { test } from 'node:test'
3
- import assert from 'node:assert/strict'
4
- import 'reflect-metadata'
5
- import { createRequire } from 'node:module'
6
-
7
- const require = createRequire(import.meta.url)
8
- const { DatosTransportistaDTO, validateAndFormatData } = require('../dist/index.js')
9
-
10
- const transportistaViejo = {
11
- Identificacion: '45879632',
12
- Nombres: 'JUAN',
13
- Apellidos: 'PEREZ',
14
- PlacaVehiculo: 'ABC123',
15
- Licencia: 'Q45879632',
16
- RUCEmpresa: '20512345678',
17
- }
18
-
19
- test('Documento viejo sin RazonSocialEmpresa pasa la validación', async () => {
20
- const result = await validateAndFormatData(transportistaViejo, DatosTransportistaDTO)
21
- assert.equal(result.Identificacion, '45879632')
22
- })
23
-
24
- test('RazonSocialEmpresa se guarda cuando viene', async () => {
25
- const result = await validateAndFormatData({ ...transportistaViejo, RazonSocialEmpresa: 'TRANSPORTES SAC' }, DatosTransportistaDTO)
26
- assert.equal(result.RazonSocialEmpresa, 'TRANSPORTES SAC')
27
- })
28
-
29
- test('RazonSocialEmpresa de más de 300 caracteres se rechaza', async () => {
30
- await assert.rejects(
31
- validateAndFormatData({ ...transportistaViejo, RazonSocialEmpresa: 'X'.repeat(301) }, DatosTransportistaDTO),
32
- /RazonSocialEmpresa/
33
- )
34
- })