alternatives to change TestBed configurations without creating the test.ts files
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- angular, typescript
Direção de pesquisa
Comece rastreando como as opções de teste de angular.json são tratadas e como o bootstrap de test.ts é gerado ou substituído. Use as configurações solicitadas do TestBed e o padrão de teste personalizado como casos de aceitação; considera-se concluído quando os projetos puderem configurá-los sem criar arquivos test.ts.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
with Angular 15, now the test.ts file doesn't get generated by default, so it's not an easy task to change the TestBed configurations for example to enable errorOnUnknownElements
it will also be nice if we can change the pattern of the tests
Proposed solution
to add the configurations inside the angular.json files in the options section of test
something like
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"inlineStyleLanguage": "scss",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.scss"
],
"scripts": [],
"errorOnUnknownElements": true, <---
"errorOnUnknownProperties": true, <---
"pattern": "\.custom-spec\.ts$" <---
}
Alternatives considered
to be able to enable them globally from any script (to create a js file and add it to the scripts of the test) with something like
getTestBed().setoptions({
errorOnUnknownElements: true,
errorOnUnknownProperties: true,
pattern: /\.custom-spec\.ts$/
});
- Linguagem predominante
- TypeScript
- Estrelas
- 27k
- Forks
- 11.8k
- Merge médio
- 16h 35min
- PRs com merge (30d)
- 176
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de angular/angular-cli
-
area: @angular/build gemini-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
angular/angular-cli#33055 · 1 comentário · 3 reações ·
-
unit-test: with --coverage, a setup file's hooks reach only the first spec file of each worker Abertaarea: @angular/build gemini-triaged
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 72/100
angular/angular-cli#34137 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 responsável ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 responsável ·
Todas as issues de angular/angular-cli
Issues semelhantes
-
[Bug]: Discord Activity titles with emoji are rejected as over 80 characters when they are not Abertaclawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
supermomonga/zcode-acp#24 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
growthbook/growthbook#7100 ·
-
triage
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100