-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ng9): update tests to use TestBed.inject
- Loading branch information
Showing
13 changed files
with
175 additions
and
180 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Deploy to GitHub Pages via angular-cli-ghpages | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build_lint_test_deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Build the app | ||
uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js 12.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
|
||
- name: Install | ||
run: CYPRESS_INSTALL_BINARY=0 yarn install | ||
|
||
- name: Lint | ||
if: success() | ||
run: yarn run lint | ||
|
||
- name: Test | ||
if: success() | ||
run: yarn run test | ||
|
||
- name: Deploy | ||
if: success() && github.event_name == 'push' | ||
run: yarn run deploy | ||
env: | ||
CI: true | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN}} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
import { NgxsModule, Store } from '@ngxs/store'; | ||
import { async, TestBed } from '@angular/core/testing'; | ||
import { AuthState } from './auth.state'; | ||
import { NgxsModule, Store } from '@ngxs/store'; | ||
import { LogoutSuccess } from './auth.actions'; | ||
import { AuthState } from './auth.state'; | ||
|
||
describe('Auth', () => { | ||
let store: Store; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [NgxsModule.forRoot([AuthState])], | ||
}).compileComponents(); | ||
store = TestBed.get(Store); | ||
TestBed | ||
.configureTestingModule({ | ||
imports: [NgxsModule.forRoot([AuthState])], | ||
}) | ||
.compileComponents(); | ||
store = TestBed.inject(Store); | ||
})); | ||
|
||
it('it toggles feed', () => { | ||
store.dispatch(new LogoutSuccess()); | ||
store | ||
.select(state => state.auth.isLoggedIn) | ||
.subscribe(isLoggedIn => { | ||
expect(isLoggedIn).toBe(false); | ||
}); | ||
store.select(state => state.auth.isLoggedIn).subscribe(isLoggedIn => { | ||
expect(isLoggedIn).toBe(false); | ||
}); | ||
}); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { FeatureService } from './feature.service'; | ||
|
||
describe('FeatureService', () => { | ||
beforeEach(() => TestBed.configureTestingModule({})); | ||
|
||
it('should be created', () => { | ||
const service: FeatureService = TestBed.get(FeatureService); | ||
const service: FeatureService = TestBed.inject(FeatureService); | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { GoogleAnalyticsService } from './google-analytics.service'; | ||
|
||
describe('GoogleAnalyticsService', () => { | ||
beforeEach(() => TestBed.configureTestingModule({})); | ||
|
||
it('should be created', () => { | ||
const service: GoogleAnalyticsService = TestBed.get(GoogleAnalyticsService); | ||
const service: GoogleAnalyticsService = | ||
TestBed.inject(GoogleAnalyticsService); | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
|
||
import { PushNotificationService } from './push-notification.service'; | ||
|
||
|
||
describe('PushNotificationService', () => { | ||
beforeEach(() => TestBed.configureTestingModule({})); | ||
|
||
it('should be created', () => { | ||
const service: PushNotificationService = TestBed.get(PushNotificationService); | ||
const service: PushNotificationService = | ||
TestBed.inject(PushNotificationService); | ||
expect(service).toBeTruthy(); | ||
}); | ||
}); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.