Skip to content

Commit 25e48ca

Browse files
committed
Getting jasmine working again, cleaning up tests
1 parent cd5f171 commit 25e48ca

File tree

5 files changed

+802
-1335
lines changed

5 files changed

+802
-1335
lines changed

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
},
4141
"homepage": "https://github.com/angular/angularfire#readme",
4242
"dependencies": {
43-
"@angular-devkit/architect": "0.1200.0-rc.0",
44-
"@angular-devkit/core": "12.0.0-rc.0",
45-
"@angular-devkit/schematics": "12.0.0-rc.0",
46-
"@angular/common": "12.0.0-rc.0",
47-
"@angular/compiler": "12.0.0-rc.0",
48-
"@angular/core": "12.0.0-rc.0",
49-
"@angular/platform-browser": "12.0.0-rc.0",
50-
"@angular/platform-browser-dynamic": "12.0.0-rc.0",
51-
"@angular/router": "12.0.0-rc.0",
43+
"@angular-devkit/architect": "~0.1200.0-rc.0",
44+
"@angular-devkit/core": "~12.0.0-rc.0",
45+
"@angular-devkit/schematics": "~12.0.0-rc.0",
46+
"@angular/common": "~12.0.0-rc.0",
47+
"@angular/compiler": "~12.0.0-rc.0",
48+
"@angular/core": "~12.0.0-rc.0",
49+
"@angular/platform-browser": "~12.0.0-rc.0",
50+
"@angular/platform-browser-dynamic": "~12.0.0-rc.0",
51+
"@angular/router": "~12.0.0-rc.0",
5252
"firebase": "^9.0.0-beta.1",
5353
"firebase-admin": "^8.10.0",
5454
"firebase-functions": "^3.6.0",
@@ -61,24 +61,24 @@
6161
"lodash.isequal": "^4.5.0",
6262
"open": "^7.0.3",
6363
"rxfire": "0.500.0-canary.0df3466",
64-
"rxjs": "^6.5.3",
64+
"rxjs": "~6.6.0",
6565
"semver": "^7.1.3",
66-
"tslib": "^2.0.0",
66+
"tslib": "^2.1.0",
6767
"ws": "^7.2.1",
6868
"xhr2": "^0.1.4",
69-
"zone.js": "0.10.2"
69+
"zone.js": "~0.11.4"
7070
},
7171
"optionalDependencies": {
7272
"bufferutil": "^4.0.1",
7373
"utf-8-validate": "^5.0.2"
7474
},
7575
"devDependencies": {
76-
"@angular-devkit/build-angular": "12.0.0-rc.0",
76+
"@angular-devkit/build-angular": "~12.0.0-rc.0",
7777
"@angular-devkit/build-ng-packagr": ">= 0.900 < 0.1300",
78-
"@angular/animations": "12.0.0-rc.0",
79-
"@angular/cli": "12.0.0-rc.0",
80-
"@angular/compiler-cli": "12.0.0-rc.0",
81-
"@angular/platform-server": "12.0.0-rc.0",
78+
"@angular/animations": "~12.0.0-rc.0",
79+
"@angular/cli": "~12.0.0-rc.0",
80+
"@angular/compiler-cli": "~12.0.0-rc.0",
81+
"@angular/platform-server": "~12.0.0-rc.0",
8282
"@types/fs-extra": "^7.0.0",
8383
"@types/gzip-size": "^5.1.1",
8484
"@types/inquirer": "^0.0.44",

sample/src/app/app.component.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import { TestBed } from '@angular/core/testing';
1+
import { TestBed, waitForAsync } from '@angular/core/testing';
22
import { RouterTestingModule } from '@angular/router/testing';
33
import { AppComponent } from './app.component';
44

55
describe('AppComponent', () => {
6-
beforeEach(async () => {
7-
await TestBed.configureTestingModule({
6+
beforeEach(waitForAsync(() => {
7+
TestBed.configureTestingModule({
88
imports: [
99
RouterTestingModule
1010
],
1111
declarations: [
1212
AppComponent
1313
],
1414
}).compileComponents();
15-
});
15+
}));
1616

1717
it('should create the app', () => {
1818
const fixture = TestBed.createComponent(AppComponent);

src/compat/auth-guard/auth-guard.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { Router, RouterModule } from '@angular/router';
66
import { APP_BASE_HREF } from '@angular/common';
77
import { rando } from '../../utils';
88

9+
class TestComponent { }
10+
911
describe('AngularFireAuthGuard', () => {
1012
let app: FirebaseApp;
1113
let router: Router;
@@ -16,7 +18,7 @@ describe('AngularFireAuthGuard', () => {
1618
AngularFireModule.initializeApp(COMMON_CONFIG, rando()),
1719
AngularFireAuthGuardModule,
1820
RouterModule.forRoot([
19-
{ path: 'a', redirectTo: '/', canActivate: [AngularFireAuthGuard] }
21+
{ path: 'a', component: TestComponent, canActivate: [AngularFireAuthGuard] }
2022
])
2123
],
2224
providers: [

tools/jasmine.js

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
11
Jasmine = require('jasmine');
22

3-
jasmine = new Jasmine();
4-
jasmine.loadConfig({
5-
spec_dir: '.',
6-
spec_files: [
7-
'dist/out-tsc/jasmine/**/*.jasmine.js',
8-
'dist/out-tsc/jasmine/**/*.spec.js'
9-
]
10-
});
11-
123
require('reflect-metadata');
134
require('zone.js/dist/zone-node');
14-
require('zone.js/dist/async-test');
15-
require('zone.js/dist/sync-test');
16-
require('zone.js/dist/fake-async-test');
17-
require('zone.js/dist/proxy');
18-
require('zone.js/dist/zone-patch-rxjs');
19-
require('zone.js/dist/task-tracking');
5+
require('zone.js/dist/zone-testing');
206

217
const { getTestBed } = require('@angular/core/testing');
228
const { platformServerTesting, ServerTestingModule } = require('@angular/platform-server/testing');
@@ -29,4 +15,13 @@ getTestBed().initTestEnvironment(
2915
platformServerTesting()
3016
);
3117

18+
jasmine = new Jasmine();
19+
jasmine.loadConfig({
20+
spec_dir: '.',
21+
spec_files: [
22+
'dist/out-tsc/jasmine/**/*.jasmine.js',
23+
'dist/out-tsc/jasmine/**/*.spec.js'
24+
]
25+
});
26+
3227
jasmine.execute();

0 commit comments

Comments
 (0)