@tech4good/angular-schematics 18.1.0 → 20.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/publish-npm/SKILL.md +35 -0
- package/.agents/skills/publish-npm/eval.yaml +17 -0
- package/CHANGELOG.md +22 -0
- package/README.md +9 -14
- package/changelog.config.json +19 -0
- package/contributing-docs/branches-and-releases.md +57 -0
- package/contributing-docs/commit-message.md +117 -0
- package/package.json +19 -10
- package/src/collection.json +3 -3
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.spec.ts.template +25 -22
- package/src/component/files/__name@dasherize__/__name@dasherize__.component.ts.template +0 -1
- package/src/component/index.js +8 -15
- package/src/component/index.js.map +1 -1
- package/src/component/index_spec.js +5 -13
- package/src/component/index_spec.js.map +1 -1
- package/src/component/schema.json +1 -0
- package/src/entity/index.js +8 -15
- package/src/entity/index.js.map +1 -1
- package/src/entity/index_spec.js +5 -13
- package/src/entity/index_spec.js.map +1 -1
- package/src/entity/schema.json +1 -0
- package/src/{init → ng-add}/files/.github/workflows/angular-github-ci.yml.template +1 -1
- package/src/{init → ng-add}/files/angular.json.template +26 -0
- package/src/ng-add/files/eslint.config.js.template +97 -0
- package/src/ng-add/files/package.json.template +71 -0
- package/src/ng-add/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +37 -0
- package/src/{init → ng-add}/files/src/app/admin/admin-panel/admin-panel.component.ts.template +0 -1
- package/src/ng-add/files/src/app/app.component.spec.ts.template +39 -0
- package/src/{init → ng-add}/files/src/app/app.component.ts.template +0 -1
- package/src/{init → ng-add}/files/src/app/core/firebase/cached-listeners.service.ts.template +2 -17
- package/src/{init → ng-add}/files/src/app/core/firebase/firebase.mock.service.ts.template +4 -2
- package/src/{init → ng-add}/files/src/app/core/firebase/firebase.service.ts.template +3 -1
- package/src/{init → ng-add}/files/src/app/core/store/auth/auth.mock.ts.template +9 -3
- package/src/ng-add/files/src/app/first-time/consent/consent.component.spec.ts.template +37 -0
- package/src/{init → ng-add}/files/src/app/first-time/consent/consent.component.ts.template +0 -1
- package/src/ng-add/files/src/app/first-time/early-access/early-access.component.spec.ts.template +40 -0
- package/src/{init → ng-add}/files/src/app/first-time/early-access/early-access.component.ts.template +1 -3
- package/src/ng-add/files/src/app/first-time/landing/landing.component.spec.ts.template +37 -0
- package/src/{init → ng-add}/files/src/app/first-time/landing/landing.component.ts.template +0 -1
- package/src/ng-add/files/src/app/first-time/login/login.component.spec.ts.template +37 -0
- package/src/{init → ng-add}/files/src/app/first-time/login/login.component.ts.template +0 -1
- package/src/ng-add/files/src/app/first-time/onboarding/onboarding.component.spec.ts.template +37 -0
- package/src/{init → ng-add}/files/src/app/first-time/onboarding/onboarding.component.ts.template +0 -1
- package/src/ng-add/files/src/app/main/home/home.component.spec.ts.template +37 -0
- package/src/{init → ng-add}/files/src/app/main/home/home.component.ts.template +0 -1
- package/src/ng-add/files/src/app/shared/navbar/navbar.component.spec.ts.template +37 -0
- package/src/{init → ng-add}/files/src/app/shared/navbar/navbar.component.ts.template +0 -1
- package/src/ng-add/files/src/app/shared/redeployment-warning/redeployment-warning.component.spec.ts.template +30 -0
- package/src/{init → ng-add}/files/src/app/shared/redeployment-warning/redeployment-warning.component.ts.template +0 -1
- package/src/ng-add/files/src/main.ts.template +6 -0
- package/src/{init → ng-add}/index.d.ts +1 -1
- package/src/{init → ng-add}/index.js +9 -16
- package/src/ng-add/index.js.map +1 -0
- package/src/{init → ng-add}/schema.json +3 -2
- package/src/shared/camelcase-formatter.js +1 -2
- package/src/shared/camelcase-formatter.js.map +1 -1
- package/src/shared/statements-adder.js +3 -4
- package/src/shared/statements-adder.js.map +1 -1
- package/tsconfig.json +10 -25
- package/src/init/files/.eslintrc.json.template +0 -120
- package/src/init/files/package.json.template +0 -68
- package/src/init/files/src/app/admin/admin-panel/admin-panel.component.spec.ts.template +0 -32
- package/src/init/files/src/app/app.component.spec.ts.template +0 -27
- package/src/init/files/src/app/first-time/consent/consent.component.spec.ts.template +0 -32
- package/src/init/files/src/app/first-time/early-access/early-access.component.spec.ts.template +0 -35
- package/src/init/files/src/app/first-time/landing/landing.component.spec.ts.template +0 -32
- package/src/init/files/src/app/first-time/login/login.component.spec.ts.template +0 -32
- package/src/init/files/src/app/first-time/onboarding/onboarding.component.spec.ts.template +0 -33
- package/src/init/files/src/app/main/home/home.component.spec.ts.template +0 -32
- package/src/init/files/src/app/shared/navbar/navbar.component.spec.ts.template +0 -32
- package/src/init/files/src/app/shared/redeployment-warning/redeployment-warning.component.spec.ts.template +0 -24
- package/src/init/index.js.map +0 -1
- /package/src/{init → ng-add}/files/.firebaserc.template +0 -0
- /package/src/{init → ng-add}/files/.gitattributes.template +0 -0
- /package/src/{init → ng-add}/files/.gitignore.template +0 -0
- /package/src/{init → ng-add}/files/CODE_OF_CONDUCT.md.template +0 -0
- /package/src/{init → ng-add}/files/CONTRIBUTING.md.template +0 -0
- /package/src/{init → ng-add}/files/README.md.template +0 -0
- /package/src/{init → ng-add}/files/contributing-docs/coding-standards.md.template +0 -0
- /package/src/{init → ng-add}/files/contributing-docs/using-fixup-commits.md.template +0 -0
- /package/src/{init → ng-add}/files/jest.config.ts.template +0 -0
- /package/src/{init → ng-add}/files/public/images/close-x.svg +0 -0
- /package/src/{init → ng-add}/files/setup-jest.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/admin/admin-panel/admin-panel.animations.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/admin/admin-panel/admin-panel.component.html.template +0 -0
- /package/src/{init → ng-add}/files/src/app/admin/admin-panel/admin-panel.component.scss.template +0 -0
- /package/src/{init → ng-add}/files/src/app/app.component.html.template +0 -0
- /package/src/{init → ng-add}/files/src/app/app.component.scss.template +0 -0
- /package/src/{init → ng-add}/files/src/app/app.config.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/app.routes.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/analytics/log.service.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/analytics/time-analytics.service.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/auth/auth.guard.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/firebase/database.service.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/local-storage/local-storage.service.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/local-storage/session-local-storage.service.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/local-storage/session.service.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/router/routing-state.service.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/app.model.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/app.store.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/auth/auth.store.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/batch-write.firebase.service.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/batch-write.mock.service.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/batch-write.service.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/user/user.mock.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/user/user.model.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/user/user.store.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/user-context/user-context.mock.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/user-context/user-context.model.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/store/user-context/user-context.store.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/core/utils/rand.utils.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/consent/consent.animations.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/consent/consent.component.html.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/consent/consent.component.scss.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/early-access/early-access.animations.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/early-access/early-access.component.html.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/early-access/early-access.component.scss.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/early-access/early-access.model.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/landing/landing.animations.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/landing/landing.component.html.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/landing/landing.component.scss.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/login/login.component.html.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/login/login.component.scss.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/onboarding/onboarding.animations.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/onboarding/onboarding.component.html.template +0 -0
- /package/src/{init → ng-add}/files/src/app/first-time/onboarding/onboarding.component.scss.template +0 -0
- /package/src/{init → ng-add}/files/src/app/main/home/home.animations.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/app/main/home/home.component.html.template +0 -0
- /package/src/{init → ng-add}/files/src/app/main/home/home.component.scss.template +0 -0
- /package/src/{init → ng-add}/files/src/app/shared/navbar/navbar.component.html.template +0 -0
- /package/src/{init → ng-add}/files/src/app/shared/navbar/navbar.component.scss.template +0 -0
- /package/src/{init → ng-add}/files/src/app/shared/redeployment-warning/redeployment-warning.component.html.template +0 -0
- /package/src/{init → ng-add}/files/src/app/shared/redeployment-warning/redeployment-warning.component.scss.template +0 -0
- /package/src/{init → ng-add}/files/src/app/shared/redeployment-warning/redeployment-warning.service.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/env.d.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/environments/environment.prod.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/environments/environment.test.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/environments/environment.ts.template +0 -0
- /package/src/{init → ng-add}/files/src/index.html.template +0 -0
- /package/src/{init → ng-add}/files/src/styles/_variables.scss.template +0 -0
- /package/src/{init → ng-add}/files/src/styles.scss.template +0 -0
- /package/src/{init → ng-add}/files/tsconfig.app.json.template +0 -0
- /package/src/{init → ng-add}/files/tsconfig.json.template +0 -0
- /package/src/{init → ng-add}/files/tsconfig.spec.json.template +0 -0
|
@@ -7,7 +7,6 @@ import { AuthStore } from 'src/app/core/store/auth/auth.store';
|
|
|
7
7
|
templateUrl: './login.component.html',
|
|
8
8
|
styleUrls: ['./login.component.scss'],
|
|
9
9
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
-
standalone: true,
|
|
11
10
|
})
|
|
12
11
|
export class LoginComponent implements OnInit {
|
|
13
12
|
authStore = inject(AuthStore);
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { render } from '@testing-library/angular';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
|
|
4
|
+
import { OnboardingComponent } from './onboarding.component';
|
|
5
|
+
import { DATABASE_SERVICE } from 'src/app/core/firebase/database.service';
|
|
6
|
+
import { FirebaseMockService } from 'src/app/core/firebase/firebase.mock.service';
|
|
7
|
+
import { BatchWriteMockService } from 'src/app/core/store/batch-write.mock.service';
|
|
8
|
+
import { BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
|
|
9
|
+
|
|
10
|
+
/** Sets up the testing environment for OnboardingComponent using render.*/
|
|
11
|
+
async function setup() {
|
|
12
|
+
const user = userEvent.setup();
|
|
13
|
+
const checkedSpy = jest.fn();
|
|
14
|
+
|
|
15
|
+
const view = await render(OnboardingComponent, {
|
|
16
|
+
imports: [],
|
|
17
|
+
providers: [
|
|
18
|
+
{ provide: DATABASE_SERVICE, useClass: FirebaseMockService },
|
|
19
|
+
{ provide: BATCH_WRITE_SERVICE, useClass: BatchWriteMockService },
|
|
20
|
+
],
|
|
21
|
+
componentInputs: {},
|
|
22
|
+
on: {},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
user,
|
|
27
|
+
fixture: view.fixture,
|
|
28
|
+
rerender: () => view.rerender(), // add component inputs if needed
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe('OnboardingComponent', () => {
|
|
33
|
+
it('should create', async () => {
|
|
34
|
+
const { fixture } = await setup();
|
|
35
|
+
expect(fixture.componentInstance).toBeTruthy();
|
|
36
|
+
});
|
|
37
|
+
});
|
package/src/{init → ng-add}/files/src/app/first-time/onboarding/onboarding.component.ts.template
RENAMED
|
@@ -9,7 +9,6 @@ import { BatchWriteService, BATCH_WRITE_SERVICE } from 'src/app/core/store/batch
|
|
|
9
9
|
templateUrl: './onboarding.component.html',
|
|
10
10
|
styleUrls: ['./onboarding.component.scss'],
|
|
11
11
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
-
standalone: true,
|
|
13
12
|
animations: OnboardingAnimations,
|
|
14
13
|
})
|
|
15
14
|
export class OnboardingComponent implements OnInit {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { render } from '@testing-library/angular';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
|
|
4
|
+
import { HomeComponent } from './home.component';
|
|
5
|
+
import { DATABASE_SERVICE } from 'src/app/core/firebase/database.service';
|
|
6
|
+
import { FirebaseMockService } from 'src/app/core/firebase/firebase.mock.service';
|
|
7
|
+
import { BatchWriteMockService } from 'src/app/core/store/batch-write.mock.service';
|
|
8
|
+
import { BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
|
|
9
|
+
|
|
10
|
+
/** Sets up the testing environment for HomeComponent using render.*/
|
|
11
|
+
async function setup() {
|
|
12
|
+
const user = userEvent.setup();
|
|
13
|
+
const checkedSpy = jest.fn();
|
|
14
|
+
|
|
15
|
+
const view = await render(HomeComponent, {
|
|
16
|
+
imports: [],
|
|
17
|
+
providers: [
|
|
18
|
+
{ provide: DATABASE_SERVICE, useClass: FirebaseMockService },
|
|
19
|
+
{ provide: BATCH_WRITE_SERVICE, useClass: BatchWriteMockService },
|
|
20
|
+
],
|
|
21
|
+
componentInputs: {},
|
|
22
|
+
on: {},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
user,
|
|
27
|
+
fixture: view.fixture,
|
|
28
|
+
rerender: () => view.rerender(), // add component inputs if needed
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe('HomeComponent', () => {
|
|
33
|
+
it('should create', async () => {
|
|
34
|
+
const { fixture } = await setup();
|
|
35
|
+
expect(fixture.componentInstance).toBeTruthy();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -10,7 +10,6 @@ import { NavbarComponent } from 'src/app/shared/navbar/navbar.component';
|
|
|
10
10
|
templateUrl: './home.component.html',
|
|
11
11
|
styleUrls: ['./home.component.scss'],
|
|
12
12
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
-
standalone: true,
|
|
14
13
|
animations: HomeAnimations,
|
|
15
14
|
imports: [
|
|
16
15
|
NavbarComponent,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { render } from '@testing-library/angular';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
|
|
4
|
+
import { NavbarComponent } from './navbar.component';
|
|
5
|
+
import { DATABASE_SERVICE } from 'src/app/core/firebase/database.service';
|
|
6
|
+
import { FirebaseMockService } from 'src/app/core/firebase/firebase.mock.service';
|
|
7
|
+
import { BatchWriteMockService } from 'src/app/core/store/batch-write.mock.service';
|
|
8
|
+
import { BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
|
|
9
|
+
|
|
10
|
+
/** Sets up the testing environment for NavbarComponent using render.*/
|
|
11
|
+
async function setup() {
|
|
12
|
+
const user = userEvent.setup();
|
|
13
|
+
const checkedSpy = jest.fn();
|
|
14
|
+
|
|
15
|
+
const view = await render(NavbarComponent, {
|
|
16
|
+
imports: [],
|
|
17
|
+
providers: [
|
|
18
|
+
{ provide: DATABASE_SERVICE, useClass: FirebaseMockService },
|
|
19
|
+
{ provide: BATCH_WRITE_SERVICE, useClass: BatchWriteMockService },
|
|
20
|
+
],
|
|
21
|
+
componentInputs: {},
|
|
22
|
+
on: {},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
user,
|
|
27
|
+
fixture: view.fixture,
|
|
28
|
+
rerender: () => view.rerender(), // add component inputs if needed
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe('NavbarComponent', () => {
|
|
33
|
+
it('should create', async () => {
|
|
34
|
+
const { fixture } = await setup();
|
|
35
|
+
expect(fixture.componentInstance).toBeTruthy();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -8,7 +8,6 @@ import { MatMenuTrigger, MatMenu } from '@angular/material/menu';
|
|
|
8
8
|
templateUrl: './navbar.component.html',
|
|
9
9
|
styleUrls: ['./navbar.component.scss'],
|
|
10
10
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
-
standalone: true,
|
|
12
11
|
imports: [MatMenuTrigger, MatMenu],
|
|
13
12
|
})
|
|
14
13
|
export class NavbarComponent implements OnInit {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { render } from '@testing-library/angular';
|
|
2
|
+
import userEvent from '@testing-library/user-event';
|
|
3
|
+
|
|
4
|
+
import { RedeploymentWarningComponent } from './redeployment-warning.component';
|
|
5
|
+
|
|
6
|
+
/** Sets up the testing environment for RedeploymentWarningComponent using render.*/
|
|
7
|
+
async function setup() {
|
|
8
|
+
const user = userEvent.setup();
|
|
9
|
+
const checkedSpy = jest.fn();
|
|
10
|
+
|
|
11
|
+
const view = await render(RedeploymentWarningComponent, {
|
|
12
|
+
imports: [],
|
|
13
|
+
providers: [],
|
|
14
|
+
componentInputs: {},
|
|
15
|
+
on: {},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
user,
|
|
20
|
+
fixture: view.fixture,
|
|
21
|
+
rerender: () => view.rerender(), // add component inputs if needed
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
describe('RedeploymentWarningComponent', () => {
|
|
26
|
+
it('should create', async () => {
|
|
27
|
+
const { fixture } = await setup();
|
|
28
|
+
expect(fixture.componentInstance).toBeTruthy();
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -5,7 +5,6 @@ import { DetectRedeploymentService } from './redeployment-warning.service';
|
|
|
5
5
|
selector: 'app-redeployment-warning',
|
|
6
6
|
templateUrl: './redeployment-warning.component.html',
|
|
7
7
|
styleUrls: ['./redeployment-warning.component.scss'],
|
|
8
|
-
standalone: true,
|
|
9
8
|
})
|
|
10
9
|
export class RedeploymentWarningComponent implements OnInit {
|
|
11
10
|
// --------------- INPUTS AND OUTPUTS ------------------
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function ngAdd(options: any): Rule;
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
3
|
+
exports.ngAdd = ngAdd;
|
|
13
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
14
5
|
//import { InsertChange } from '@schematics/angular/utility/change';
|
|
15
6
|
//import { buildRelativePath, findModuleFromOptions } from '@schematics/angular/utility/find-module';
|
|
@@ -18,15 +9,15 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
18
9
|
const workspace_1 = require("@schematics/angular/utility/workspace");
|
|
19
10
|
const core_1 = require("@angular-devkit/core");
|
|
20
11
|
//import { getSourceText, simpleInsert } from '../shared/statements-adder';
|
|
21
|
-
function
|
|
22
|
-
return (tree, context) =>
|
|
12
|
+
function ngAdd(options) {
|
|
13
|
+
return async (tree, context) => {
|
|
23
14
|
// Warn them that this should only be used on a new repo and ask if they want to proceed
|
|
24
15
|
if (!options.proceed) {
|
|
25
16
|
context.logger.info("Cancelling generation request. This schematic should only be used to generate initial files on FRESH repos created from ng new.");
|
|
26
17
|
return (0, schematics_1.noop)();
|
|
27
18
|
}
|
|
28
19
|
context.logger.info(`options.project: ${options.project}`);
|
|
29
|
-
const workspace =
|
|
20
|
+
const workspace = await (0, workspace_1.getWorkspace)(tree);
|
|
30
21
|
const project = workspace.projects.get(options.project);
|
|
31
22
|
if (!project) {
|
|
32
23
|
throw new schematics_1.SchematicsException(`Project "${options.project}" does not exist.`);
|
|
@@ -37,13 +28,15 @@ function init(options) {
|
|
|
37
28
|
//options.name = parsedPath.name;
|
|
38
29
|
//options.path = parsedPath.path;
|
|
39
30
|
const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
|
40
|
-
(0, schematics_1.applyTemplates)(
|
|
31
|
+
(0, schematics_1.applyTemplates)({
|
|
32
|
+
...core_1.strings,
|
|
33
|
+
...options,
|
|
34
|
+
}),
|
|
41
35
|
//move(parsedPath.path),
|
|
42
36
|
]);
|
|
43
37
|
return (0, schematics_1.chain)([
|
|
44
38
|
(0, schematics_1.mergeWith)(templateSource, schematics_1.MergeStrategy.Overwrite)
|
|
45
39
|
]);
|
|
46
|
-
}
|
|
40
|
+
};
|
|
47
41
|
}
|
|
48
|
-
exports.init = init;
|
|
49
42
|
//#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F,wBAAwB;SACzB,CAAC,CAAC;QAEH,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,sBAAS,EAAC,cAAc,EAAE,0BAAa,CAAC,SAAS,CAAC;SACnD,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"$id": "
|
|
4
|
-
"title": "
|
|
3
|
+
"$id": "NgAddSchema",
|
|
4
|
+
"title": "Ng Add Schema",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"description": "Adds initial project files to a newly created repo.",
|
|
7
7
|
"properties": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"proceed": {
|
|
20
20
|
"type": "boolean",
|
|
21
|
+
"default": true,
|
|
21
22
|
"x-prompt": "This schematic is only designed for generating initial files on a FRESH repo created from ng new. If you use this outside of that context, YOU WILL OVERWRITE parts of your existing code. Are you sure you want to proceed?"
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CamelCaseFormatter =
|
|
3
|
+
exports.CamelCaseFormatter = CamelCaseFormatter;
|
|
4
4
|
function CamelCaseFormatter(name, lower) {
|
|
5
5
|
// e.g. list-style-image to ListStyleImage
|
|
6
6
|
let camelName = name.charAt(0).toUpperCase() + name.substr(1);
|
|
@@ -15,5 +15,4 @@ function CamelCaseFormatter(name, lower) {
|
|
|
15
15
|
camelName = camelName.charAt(0).toLowerCase() + camelName.substr(1);
|
|
16
16
|
return camelName;
|
|
17
17
|
}
|
|
18
|
-
exports.CamelCaseFormatter = CamelCaseFormatter;
|
|
19
18
|
//# sourceMappingURL=camelcase-formatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camelcase-formatter.js","sourceRoot":"","sources":["camelcase-formatter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"camelcase-formatter.js","sourceRoot":"","sources":["camelcase-formatter.ts"],"names":[],"mappings":";;AAAA,gDAaC;AAbD,SAAgB,kBAAkB,CAAC,IAAY,EAAE,KAAc;IAC3D,0CAA0C;IAC1C,IAAI,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9D,IAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAG,CAAC,EAAE,EAAC,CAAC;YACnC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACrE,CAAC;QACD,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/B,CAAC;IACD,IAAI,KAAK;QACL,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACxE,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getSourceText = getSourceText;
|
|
4
|
+
exports.simpleInsert = simpleInsert;
|
|
5
|
+
exports.AddStatements = AddStatements;
|
|
4
6
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
7
|
const change_1 = require("@schematics/angular/utility/change");
|
|
6
8
|
function getSourceText(host, filePath) {
|
|
@@ -10,7 +12,6 @@ function getSourceText(host, filePath) {
|
|
|
10
12
|
}
|
|
11
13
|
return text.toString('utf-8');
|
|
12
14
|
}
|
|
13
|
-
exports.getSourceText = getSourceText;
|
|
14
15
|
function simpleInsert(sourceText, fileToEdit, labels, statements) {
|
|
15
16
|
let labelMap = {};
|
|
16
17
|
return labels.map((label, i) => {
|
|
@@ -22,7 +23,6 @@ function simpleInsert(sourceText, fileToEdit, labels, statements) {
|
|
|
22
23
|
return new change_1.InsertChange(fileToEdit, index, `\n${statements[i]}`);
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
exports.simpleInsert = simpleInsert;
|
|
26
26
|
function AddStatements(filePath, labels, statements, tree) {
|
|
27
27
|
// getSourceText
|
|
28
28
|
let text = tree.read(filePath); // reads the file from the tree
|
|
@@ -46,7 +46,6 @@ function AddStatements(filePath, labels, statements, tree) {
|
|
|
46
46
|
}
|
|
47
47
|
tree.commitUpdate(exportRecorder);
|
|
48
48
|
}
|
|
49
|
-
exports.AddStatements = AddStatements;
|
|
50
49
|
function getPosition(string, subString, index) {
|
|
51
50
|
return string.split(subString, index).join(subString).length;
|
|
52
51
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statements-adder.js","sourceRoot":"","sources":["statements-adder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"statements-adder.js","sourceRoot":"","sources":["statements-adder.ts"],"names":[],"mappings":";;AAOA,sCAMC;AAED,oCAWC;AAED,sCAyBG;AArDH,2DAAuE;AACvE,+DAA0E;AAM1E,SAAgB,aAAa,CAAC,IAAU,EAAE,QAAgB;IACxD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,MAAM,IAAI,gCAAmB,CAAC,QAAQ,QA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|
"declaration": true,
|
|
9
6
|
"module": "commonjs",
|
|
10
7
|
"moduleResolution": "node",
|
|
11
8
|
"noEmitOnError": true,
|
|
12
|
-
"noFallthroughCasesInSwitch": true,
|
|
13
|
-
"noImplicitAny": true,
|
|
14
|
-
"noImplicitThis": true,
|
|
15
|
-
"noUnusedParameters": true,
|
|
16
|
-
"noUnusedLocals": true,
|
|
17
|
-
"rootDir": "src/",
|
|
18
|
-
"skipDefaultLibCheck": true,
|
|
19
9
|
"skipLibCheck": true,
|
|
20
10
|
"sourceMap": true,
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"types": [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
]
|
|
11
|
+
"target": "es2021",
|
|
12
|
+
"rootDir": "src",
|
|
13
|
+
"types": ["jasmine", "node"],
|
|
14
|
+
"esModuleInterop": true,
|
|
15
|
+
"importHelpers": true
|
|
27
16
|
},
|
|
28
|
-
"include": [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"exclude": [
|
|
32
|
-
"src/*/files/**/*"
|
|
33
|
-
]
|
|
34
|
-
}
|
|
17
|
+
"include": ["src/**/*"],
|
|
18
|
+
"exclude": ["src/*/files/**/*"]
|
|
19
|
+
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
"ignorePatterns": [
|
|
4
|
-
"projects/**/*"
|
|
5
|
-
],
|
|
6
|
-
"overrides": [
|
|
7
|
-
{
|
|
8
|
-
"files": [
|
|
9
|
-
"*.ts"
|
|
10
|
-
],
|
|
11
|
-
"parserOptions": {
|
|
12
|
-
"project": [
|
|
13
|
-
"tsconfig.json"
|
|
14
|
-
],
|
|
15
|
-
"createDefaultProgram": true
|
|
16
|
-
},
|
|
17
|
-
"extends": [
|
|
18
|
-
"plugin:@angular-eslint/recommended",
|
|
19
|
-
"plugin:@angular-eslint/template/process-inline-templates",
|
|
20
|
-
"eslint:recommended",
|
|
21
|
-
"plugin:@typescript-eslint/recommended",
|
|
22
|
-
"google"
|
|
23
|
-
],
|
|
24
|
-
"rules": {
|
|
25
|
-
"@angular-eslint/component-selector": [
|
|
26
|
-
"error",
|
|
27
|
-
{
|
|
28
|
-
"prefix": "app",
|
|
29
|
-
"style": "kebab-case",
|
|
30
|
-
"type": "element"
|
|
31
|
-
}
|
|
32
|
-
],
|
|
33
|
-
"@angular-eslint/directive-selector": [
|
|
34
|
-
"error",
|
|
35
|
-
{
|
|
36
|
-
"prefix": "app",
|
|
37
|
-
"style": "camelCase",
|
|
38
|
-
"type": "attribute"
|
|
39
|
-
}
|
|
40
|
-
],
|
|
41
|
-
"@angular-eslint/no-empty-lifecycle-method": "off",
|
|
42
|
-
"@typescript-eslint/no-empty-function": "off",
|
|
43
|
-
"@typescript-eslint/no-unused-vars": "off",
|
|
44
|
-
"@typescript-eslint/no-inferrable-types": "off",
|
|
45
|
-
"@typescript-eslint/no-empty-interface": "off",
|
|
46
|
-
"max-len": "off",
|
|
47
|
-
"require-jsdoc": "off",
|
|
48
|
-
"valid-jsdoc": "off",
|
|
49
|
-
"no-unused-vars": "off",
|
|
50
|
-
"new-cap": "off",
|
|
51
|
-
"object-curly-spacing": ["error", "always"],
|
|
52
|
-
"quotes": ["error", "single", {
|
|
53
|
-
"allowTemplateLiterals": true,
|
|
54
|
-
"avoidEscape": true
|
|
55
|
-
}],
|
|
56
|
-
"spaced-comment": ["error", "always", {
|
|
57
|
-
"line": {
|
|
58
|
-
"markers": ["/"],
|
|
59
|
-
"exceptions": ["-", "+"]
|
|
60
|
-
},
|
|
61
|
-
"block": {
|
|
62
|
-
"markers": ["!"],
|
|
63
|
-
"exceptions": ["*"],
|
|
64
|
-
"balanced": true
|
|
65
|
-
}
|
|
66
|
-
}],
|
|
67
|
-
"indent": "off",
|
|
68
|
-
"@typescript-eslint/indent": [
|
|
69
|
-
"error", 2, {
|
|
70
|
-
"CallExpression": {
|
|
71
|
-
"arguments": 1
|
|
72
|
-
},
|
|
73
|
-
"MemberExpression": "off",
|
|
74
|
-
"ObjectExpression": 1,
|
|
75
|
-
"ArrayExpression": 1,
|
|
76
|
-
"SwitchCase": 1,
|
|
77
|
-
"FunctionDeclaration": {
|
|
78
|
-
"body": 1,
|
|
79
|
-
"parameters": 1
|
|
80
|
-
},
|
|
81
|
-
"FunctionExpression": {
|
|
82
|
-
"body": 1,
|
|
83
|
-
"parameters": 1
|
|
84
|
-
},
|
|
85
|
-
"ignoredNodes": [
|
|
86
|
-
"ConditionalExpression",
|
|
87
|
-
"FunctionExpression > .params[decorators.length > 0]",
|
|
88
|
-
"FunctionExpression > .params > :matches(Decorator, :not(:first-child))",
|
|
89
|
-
"ClassBody.body > PropertyDefinition[decorators.length > 0] > .key"
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
]
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"files": [
|
|
97
|
-
"*.actions.ts",
|
|
98
|
-
"*.selectors.ts",
|
|
99
|
-
"*.spec.ts",
|
|
100
|
-
"*.effects.ts",
|
|
101
|
-
"src/app/core/store/**/*.service.ts",
|
|
102
|
-
"src/app/core/firebase/*.service.ts",
|
|
103
|
-
"src/app/core/analytics/time-analytics.service.ts",
|
|
104
|
-
"src/app/core/setup/module-import-guard.ts"
|
|
105
|
-
],
|
|
106
|
-
"rules": {
|
|
107
|
-
"@typescript-eslint/no-explicit-any": "off"
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"files": [
|
|
112
|
-
"*.html"
|
|
113
|
-
],
|
|
114
|
-
"extends": [
|
|
115
|
-
"plugin:@angular-eslint/template/recommended"
|
|
116
|
-
],
|
|
117
|
-
"rules": {}
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "<%= dasherize(project) %>",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"ng": "ng",
|
|
7
|
-
"start": "ng serve",
|
|
8
|
-
"build": "ng build",
|
|
9
|
-
"watch": "ng build --watch --configuration development",
|
|
10
|
-
"test": "jest",
|
|
11
|
-
"test:watch": "jest --watch",
|
|
12
|
-
"test:coverage": "jest --coverage",
|
|
13
|
-
"lint": "ng lint",
|
|
14
|
-
"lintfix": "ng lint --fix"
|
|
15
|
-
},
|
|
16
|
-
"private": true,
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"@angular/animations": "^18.0.0",
|
|
19
|
-
"@angular/cdk": "^18.0.6",
|
|
20
|
-
"@angular/common": "^18.0.0",
|
|
21
|
-
"@angular/compiler": "^18.0.0",
|
|
22
|
-
"@angular/core": "^18.0.0",
|
|
23
|
-
"@angular/fire": "^18.0.1",
|
|
24
|
-
"@angular/forms": "^18.0.0",
|
|
25
|
-
"@angular/material": "^18.0.6",
|
|
26
|
-
"@angular/platform-browser": "^18.0.0",
|
|
27
|
-
"@angular/platform-browser-dynamic": "^18.0.0",
|
|
28
|
-
"@angular/router": "^18.0.0",
|
|
29
|
-
"@ngrx/signals": "^18.0.0",
|
|
30
|
-
"core-js": "^3.37.1",
|
|
31
|
-
"cross-fetch": "^4.0.0",
|
|
32
|
-
"crypto-es": "^2.1.0",
|
|
33
|
-
"dotenv": "^16.4.5",
|
|
34
|
-
"globalthis": "^1.0.4",
|
|
35
|
-
"ngx-env": "^0.1.0",
|
|
36
|
-
"proxy-polyfill": "^0.3.2",
|
|
37
|
-
"rxjs": "~7.8.0",
|
|
38
|
-
"tslib": "^2.3.0",
|
|
39
|
-
"zone.js": "~0.14.3"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@angular-devkit/build-angular": "^18.0.7",
|
|
43
|
-
"@angular-eslint/builder": "^18.1.0",
|
|
44
|
-
"@angular-eslint/eslint-plugin": "^18.1.0",
|
|
45
|
-
"@angular-eslint/eslint-plugin-template": "^18.1.0",
|
|
46
|
-
"@angular-eslint/schematics": "^18.1.0",
|
|
47
|
-
"@angular-eslint/template-parser": "^18.1.0",
|
|
48
|
-
"@angular/cli": "^18.0.7",
|
|
49
|
-
"@angular/compiler-cli": "^18.0.0",
|
|
50
|
-
"@ngx-env/builder": "^18.0.1",
|
|
51
|
-
"@tech4good/angular-schematics": "^18.1.0",
|
|
52
|
-
"@types/estree": "^1.0.0",
|
|
53
|
-
"@types/jest": "^29.5.14",
|
|
54
|
-
"@types/node": "^18.19.47",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "6.10.0",
|
|
56
|
-
"@typescript-eslint/parser": "6.10.0",
|
|
57
|
-
"@testing-library/angular": "^17.3.6",
|
|
58
|
-
"@testing-library/jest-dom": "^6.6.3",
|
|
59
|
-
"eslint-config-google": "^0.14.0",
|
|
60
|
-
"jest": "^29.7.0",
|
|
61
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
62
|
-
"jest-preset-angular": "^14.5.1",
|
|
63
|
-
"typescript": "~5.4.2",
|
|
64
|
-
"ts-jest": "^29.3.4",
|
|
65
|
-
"ts-jest-mock-import-meta": "^1.3.0",
|
|
66
|
-
"ts-node": "^10.9.2"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { AdminPanelComponent } from './admin-panel.component';
|
|
4
|
-
import { DATABASE_SERVICE } from 'src/app/core/firebase/database.service';
|
|
5
|
-
import { FirebaseMockService } from 'src/app/core/firebase/firebase.mock.service';
|
|
6
|
-
import { BatchWriteMockService } from 'src/app/core/store/batch-write.mock.service';
|
|
7
|
-
import { BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
|
|
8
|
-
|
|
9
|
-
describe('AdminPanelComponent', () => {
|
|
10
|
-
let component: AdminPanelComponent;
|
|
11
|
-
let fixture: ComponentFixture<AdminPanelComponent>;
|
|
12
|
-
|
|
13
|
-
beforeEach(waitForAsync(() => {
|
|
14
|
-
TestBed.configureTestingModule({
|
|
15
|
-
imports: [AdminPanelComponent],
|
|
16
|
-
providers: [
|
|
17
|
-
{ provide: DATABASE_SERVICE, useClass: FirebaseMockService },
|
|
18
|
-
{ provide: BATCH_WRITE_SERVICE, useClass: BatchWriteMockService },
|
|
19
|
-
],
|
|
20
|
-
}).compileComponents();
|
|
21
|
-
}));
|
|
22
|
-
|
|
23
|
-
beforeEach(() => {
|
|
24
|
-
fixture = TestBed.createComponent(AdminPanelComponent);
|
|
25
|
-
component = fixture.componentInstance;
|
|
26
|
-
fixture.detectChanges();
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('should create', () => {
|
|
30
|
-
expect(component).toBeTruthy();
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { AppComponent } from './app.component';
|
|
4
|
-
import { DATABASE_SERVICE } from 'src/app/core/firebase/database.service';
|
|
5
|
-
import { FirebaseMockService } from 'src/app/core/firebase/firebase.mock.service';
|
|
6
|
-
import { BatchWriteMockService } from 'src/app/core/store/batch-write.mock.service';
|
|
7
|
-
import { BATCH_WRITE_SERVICE } from 'src/app/core/store/batch-write.service';
|
|
8
|
-
import { LOG_SERVICE, LogInDevService } from './core/analytics/log.service';
|
|
9
|
-
|
|
10
|
-
describe('AppComponent', () => {
|
|
11
|
-
beforeEach(async () => {
|
|
12
|
-
await TestBed.configureTestingModule({
|
|
13
|
-
imports: [AppComponent],
|
|
14
|
-
providers: [
|
|
15
|
-
{ provide: DATABASE_SERVICE, useClass: FirebaseMockService },
|
|
16
|
-
{ provide: BATCH_WRITE_SERVICE, useClass: BatchWriteMockService },
|
|
17
|
-
{ provide: LOG_SERVICE, useClass: LogInDevService },
|
|
18
|
-
],
|
|
19
|
-
}).compileComponents();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create the app', () => {
|
|
23
|
-
const fixture = TestBed.createComponent(AppComponent);
|
|
24
|
-
const app = fixture.componentInstance;
|
|
25
|
-
expect(app).toBeTruthy();
|
|
26
|
-
});
|
|
27
|
-
});
|