File tree 7 files changed +293
-183
lines changed
7 files changed +293
-183
lines changed Original file line number Diff line number Diff line change 1
1
version : 2.1
2
2
orbs :
3
- coveralls : coveralls/coveralls@2.2.1
3
+ browser-tools : circleci/browser-tools@1
4
+ # coveralls: coveralls/coveralls@2.2.1
4
5
jobs :
5
6
build :
6
7
docker :
39
40
- run :
40
41
name : Run Tests and Check Code Coverage
41
42
command : npm run test:ci
42
- environment :
43
- JEST_JUNIT_OUTPUT_DIR : ./test_results/
44
- - store_test_results :
45
- path : ./test_results
46
- - store_artifacts :
47
- path : ./coverage
48
-
49
- # upload coverage report to coveralls for readme badge support
50
- # requires config.yml version 2.1 and orbs: coveralls: coveralls/coveralls@1.0.4
51
- # requires coveralls account and token specific to repo to be stored in CircleCI
52
- # - coveralls/upload
53
43
54
44
- run : npm run build
55
45
- run : npm pack
68
58
root : /tmp/workspace
69
59
paths :
70
60
- pkg
61
+ test-with-project :
62
+ docker :
63
+ - image : cimg/node:lts-browsers
64
+ working_directory : ~/
65
+ steps :
66
+ - attach_workspace :
67
+ at : /tmp/workspace
68
+ - run :
69
+ name : Setup lemon-mart
70
+ command : |
71
+ git clone https://github.com/duluca/lemon-mart
72
+ cd lemon-mart
73
+ npm ci
74
+ - browser-tools/install-chrome
75
+ - browser-tools/install-chromedriver
76
+ - run :
77
+ name : Apply angular-unit-test-helper
78
+ command : |
79
+ set -exu
80
+ cd lemon-mart
81
+ npm install /tmp/workspace/pkg/angular-unit-test-helper-*.tgz
82
+ - run :
83
+ name : Run lemon-mart tests
84
+ command : |
85
+ cd lemon-mart
86
+ npx ng test --watch=false --project lemon-mart
71
87
deploy :
72
88
docker :
73
89
- image : cimg/node:lts
@@ -101,25 +117,31 @@ workflows:
101
117
build-and-deploy :
102
118
jobs :
103
119
- build
104
- - hold :
105
- type : approval
120
+ - test-with-project :
106
121
requires :
107
122
- build
108
123
filters :
109
124
branches :
110
- only : main
111
- - deploy :
112
- context : npm
113
- requires :
114
- - hold
115
- - hold-beta :
125
+ ignore : main
126
+ - hold :
116
127
type : approval
117
128
requires :
118
129
- build
119
130
filters :
120
131
branches :
121
- ignore : main
122
- - deploy-beta :
132
+ only : main
133
+ - deploy :
123
134
context : npm
124
135
requires :
125
- - hold-beta
136
+ - hold
137
+ # - hold-beta:
138
+ # type: approval
139
+ # requires:
140
+ # - build
141
+ # filters:
142
+ # branches:
143
+ # ignore: main
144
+ # - deploy-beta:
145
+ # context: npm
146
+ # requires:
147
+ # - hold-beta
Original file line number Diff line number Diff line change 20
20
"editor.formatOnSave" : true ,
21
21
"editor.minimap.enabled" : false ,
22
22
"editor.codeActionsOnSave" : {
23
- "source.organizeImports" : false ,
24
- "source.fixAll.tslint" : true
23
+ "source.organizeImports" : " never " ,
24
+ "source.fixAll.tslint" : " explicit "
25
25
},
26
26
"editor.defaultFormatter" : " esbenp.prettier-vscode" ,
27
27
"explorer.openEditors.visible" : 0 ,
37
37
},
38
38
"[ignore]" : {
39
39
"editor.defaultFormatter" : " foxundermoon.shell-format"
40
- }
40
+ },
41
+ "angular.enable-strict-mode-prompt" : false
41
42
}
Original file line number Diff line number Diff line change @@ -152,6 +152,25 @@ Replaces boilerplate
152
152
class MockCurrentWeatherComponent {}
153
153
```
154
154
155
+ ### ` getNativeElementByTestId<TComponent>(fixture: ComponentFixture<TComponent>, testId: string = '') `
156
+
157
+ Helper function to retrieve the native element associated with a specific `data-testid`` within a component fixture.
158
+
159
+ Usage
160
+
161
+ ``` html
162
+ <span class =" left-pad" data-testid =" title" >LemonMart</span >
163
+ ```
164
+
165
+ ``` ts
166
+ it (' should render title' , () => {
167
+ const fixture = TestBed .createComponent (AppComponent )
168
+ fixture .detectChanges ()
169
+ const titleElement = getNativeElementByTestId (fixture , ' title' )
170
+ expect (titleElement .textContent ).toContain (' LemonMart' )
171
+ })
172
+ ```
173
+
155
174
### ` injectClass<TDependency>(dependency: Type<TDependency> | AbstractType<TDependency>): TDependency `
156
175
157
176
Helper function to inject a dependency, like a service, into the TestBed with a typed return variable.
You can’t perform that action at this time.
0 commit comments