1
resposta

Empty value: ,,,0,1,app: Expected function to throw an exception.

Empty value: ,,,0,1,app: Expected function to throw an exception.
Error: Empty value: ,,,0,1,app: Expected function to throw an exception.
    at <Jasmine>
    at http://localhost:9876/_karma_webpack_/webpack:/src/app/shared/services/unuique-id/unique-id.service.spec.ts:41:10
    at <Jasmine>
    at UserContext.<anonymous> (http://localhost:9876/_karma_webpack_/webpack:/src/app/shared/services/unuique-id/unique-id.service.spec.ts:38:17)

Estou tendo esse erro, ja conferi as aulas. Ele esta dando erro no "0 e 1" mesmo usando a expresão regular.

private validId = /^[A-Za-z]+[\w-:.]*$/;

Teria o cdigo desse curso?

1 resposta

Confira novamente sua expressão regular. Ela está incorreta. A expressão correta seria :/^[A-Za-z/]+[\w-:.]*$/;