Skip to content

Commit

Permalink
chor(): Upgrade ng18
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpu committed Oct 3, 2024
1 parent 09739d6 commit c4b435f
Show file tree
Hide file tree
Showing 8 changed files with 1,995 additions and 1,537 deletions.
35 changes: 16 additions & 19 deletions apps/ngx-md-demo/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,22 @@ import { TablesComponent } from './tables/tables.component';
import { PathComponent } from './path/path.component';
import { VariableBindComponent } from './variable-bind/variable-bind.component';
import { TodoComponent } from './todo/todo.component';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { AppRoutingModule } from './app.router.module';

@NgModule({
declarations: [
AppComponent,
HomeComponent,
TablesComponent,
PathComponent,
VariableBindComponent,
TodoComponent,
],
imports: [
HttpClientModule,
BrowserModule,
FormsModule,
NgxMdModule.forRoot(),
AppRoutingModule,
],
bootstrap: [AppComponent],
})
@NgModule({ declarations: [
AppComponent,
HomeComponent,
TablesComponent,
PathComponent,
VariableBindComponent,
TodoComponent,
],
bootstrap: [AppComponent],
imports: [
BrowserModule,
FormsModule,
NgxMdModule.forRoot(),
AppRoutingModule],
providers: [provideHttpClient(withInterceptorsFromDi())] })
export class AppModule {}
9 changes: 5 additions & 4 deletions apps/ngx-md-demo/src/app/path/path.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { PathComponent } from './path.component';
import { NgxMdModule } from 'libs/ngx-md/src';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

describe('PathComponent', () => {
let component: PathComponent;
let fixture: ComponentFixture<PathComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [PathComponent],
imports: [NgxMdModule.forRoot(), HttpClientModule],
}).compileComponents();
declarations: [PathComponent],
imports: [NgxMdModule.forRoot()],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).compileComponents();
}));

beforeEach(() => {
Expand Down
9 changes: 5 additions & 4 deletions apps/ngx-md-demo/src/app/tables/tables.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { TablesComponent } from './tables.component';
import { NgxMdModule } from 'libs/ngx-md/src';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

describe('TablesComponent', () => {
let component: TablesComponent;
let fixture: ComponentFixture<TablesComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [TablesComponent],
imports: [NgxMdModule.forRoot(), HttpClientModule],
}).compileComponents();
declarations: [TablesComponent],
imports: [NgxMdModule.forRoot()],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).compileComponents();
}));

beforeEach(() => {
Expand Down
9 changes: 5 additions & 4 deletions apps/ngx-md-demo/src/app/todo/todo.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { TodoComponent } from './todo.component';
import { NgxMdModule } from 'libs/ngx-md/src';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

describe('TodoComponent', () => {
let component: TodoComponent;
let fixture: ComponentFixture<TodoComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [TodoComponent],
imports: [NgxMdModule.forRoot(), HttpClientModule],
}).compileComponents();
declarations: [TodoComponent],
imports: [NgxMdModule.forRoot()],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).compileComponents();
}));

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,20 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { VariableBindComponent } from './variable-bind.component';
import { NgxMdModule } from 'libs/ngx-md/src';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

describe('VariableBindComponent', () => {
let component: VariableBindComponent;
let fixture: ComponentFixture<VariableBindComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [VariableBindComponent],
imports: [
NgxMdModule.forRoot(),
HttpClientModule,
declarations: [VariableBindComponent],
imports: [NgxMdModule.forRoot(),
FormsModule,
ReactiveFormsModule,
],
}).compileComponents();
ReactiveFormsModule],
providers: [provideHttpClient(withInterceptorsFromDi())]
}).compileComponents();
}));

beforeEach(() => {
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^17.3.12",
"@angular/common": "^17.3.12",
"@angular/compiler": "^17.3.12",
"@angular/core": "^17.3.12",
"@angular/forms": "^17.3.12",
"@angular/platform-browser": "^17.3.12",
"@angular/platform-browser-dynamic": "^17.3.12",
"@angular/router": "^17.3.12",
"@angular/animations": "^18.2.7",
"@angular/common": "^18.2.7",
"@angular/compiler": "^18.2.7",
"@angular/core": "^18.2.7",
"@angular/forms": "^18.2.7",
"@angular/platform-browser": "^18.2.7",
"@angular/platform-browser-dynamic": "^18.2.7",
"@angular/router": "^18.2.7",
"@types/he": "^1.1.2",
"@types/marked": "^4.0.3",
"he": "^1.2.0",
Expand All @@ -61,9 +61,9 @@
"zone.js": "^0.14.10"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.3.10",
"@angular/cli": "^17.3.10",
"@angular/compiler-cli": "^17.3.12",
"@angular-devkit/build-angular": "^18.2.7",
"@angular/cli": "^18.2.7",
"@angular/compiler-cli": "^18.2.7",
"@types/jasmine": "~4.0.0",
"@types/prismjs": "^1.26.0",
"gh-pages": "^4.0.0",
Expand All @@ -73,7 +73,7 @@
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"ng-packagr": "^17.3.0",
"ng-packagr": "^18.2.1",
"typescript": "^5.4.5"
},
"auto": {
Expand Down
13 changes: 5 additions & 8 deletions projects/ngx-md/src/lib/ngx-md.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { TestBed, inject, waitForAsync } from '@angular/core/testing';
import { HttpClient } from '@angular/common/http';
import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';

import {
HttpClientTestingModule,
HttpTestingController,
} from '@angular/common/http/testing';
import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing';
import { NgxMdService } from './ngx-md.service';
import { Type } from '@angular/core';

Expand All @@ -15,9 +12,9 @@ describe('NgxMdService', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
providers: [NgxMdService],
teardown: { destroyAfterEach: false }
teardown: { destroyAfterEach: false },
imports: [],
providers: [NgxMdService, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()]
});

// Inject the http service and test controller for each test
Expand Down
Loading

0 comments on commit c4b435f

Please sign in to comment.