Skip to content

Commit 7e668b5

Browse files
committed
Update README.md to reflect upgrade to ASP.NET Core 5.0
1 parent a243481 commit 7e668b5

File tree

6 files changed

+23
-19
lines changed

6 files changed

+23
-19
lines changed

FullStackTesting/FullStackTesting.Web.Api/ClientApp/src/main.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import { snotifyDefaults } from '@/config/vue-snotify.config';
1111

1212
Vue.config.productionTip = false;
1313

14-
Vue.use(VModal)
15-
.use(vClickOutside)
16-
.use(Snotify, snotifyDefaults);
14+
Vue.use(VModal);
15+
Vue.use(vClickOutside);
16+
Vue.use(Snotify, snotifyDefaults);
1717

1818
new Vue({
1919
router,

FullStackTesting/FullStackTesting.Web.Api/ClientApp/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"tests/**/*.tsx"
3737
],
3838
"exclude": [
39-
"bin",
4039
"node_modules"
4140
]
4241
}

FullStackTesting/FullStackTesting.Web.Api/ClientApp/vue.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ module.exports = {
77
}
88

99
return {
10-
devtool: false,
1110
performance: {
1211
hints: false,
13-
maxEntrypointSize: 512000,
14-
maxAssetSize: 512000
1512
},
1613
plugins: [],
1714
};

FullStackTesting/FullStackTesting.Web.Api/Persistence/Contexts/AppDbSeedData.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public static void LoadSeedData(AppDbContext dbContext)
1111
dbContext.Employees.Add(new Employee { Id = 3, FirstName = "Bob", LastName = "Smith", Department = "Human Resources", FullTime = true });
1212
dbContext.Employees.Add(new Employee { Id = 4, FirstName = "Debbie", LastName = "Test", Department = "Information Technology", FullTime = true });
1313
dbContext.Employees.Add(new Employee { Id = 5, FirstName = "Jeremy", LastName = "Wu", Department = "Claims", FullTime = false });
14+
1415
dbContext.SaveChanges();
1516
}
1617
}

FullStackTesting/FullStackTesting.Web.Api/Startup.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
8282
});
8383

8484
app.UseCors(_corsPolicyName);
85+
8586
app.UseHttpsRedirection();
8687
app.UseStaticFiles();
8788
app.UseSpaStaticFiles();
@@ -95,20 +96,16 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
9596
endpoints.MapToVueCliProxy(
9697
"{*path}",
9798
new SpaOptions { SourcePath = _spaSourcePath },
98-
"serve",
99-
regex: "running at"
99+
npmScript: "serve",
100+
regex: "running at",
101+
forceKill: true
100102
);
101103
}
102104
else
103105
{
104106
endpoints.MapFallbackToFile("index.html");
105107
}
106108
});
107-
108-
app.UseSpa(spa =>
109-
{
110-
spa.Options.SourcePath = _spaSourcePath;
111-
});
112109
}
113110
}
114111
}

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Full-Stack Testing (.NET 5.0 & Vue.js)
2-
Prototype application with a Vue.js client that has significant unit testing coverage with Vue Test Utils (Jest as the test runner) and configured for e2e testing with Nightwatch. The web API is built using .NET 5.0 and unit/integration testing is handled using xUnit.core. Has a basic, functional UI for executing requests to a back-end web api.
1+
# Full-Stack Testing (ASP.NET Core 5.0 & Vue.js)
2+
Prototype application with a Vue.js client that has significant unit testing coverage with Vue Test Utils (Jest as the test runner) and configured for e2e testing with Nightwatch. The web API is built using ASP.NET Core 5.0 and unit/integration testing is handled using xUnit.core. Has a basic, functional UI for executing requests to a back-end web api.
33

44
## Demo
55

@@ -14,7 +14,7 @@ Prototype application with a Vue.js client that has significant unit testing cov
1414
- [`vuex-module-decorators`](https://github.com/championswimmer/vuex-module-decorators) which enables you to write class based vuex store modules
1515
- [`vue-snotify`](https://github.com/artemsky/vue-snotify) snackbar notifications (based off the original library for Angular)
1616
- [`vue-js-modal`](https://github.com/euvl/vue-js-modal) for displaying compiled templates as modal components, or the option to create modals dynamically at runtime (my preferred modal plugin for Vue.js)
17-
- Back-end Web API using ```.NET 5.0``` and a seperate ```xUnit.core``` test project (for integration testing of Web API). For both Development and xUnit tests I am using the ```InMemory``` database option with ```Entity Framework Core``` for convienence
17+
- Back-end Web API using ```ASP.NET Core 5.0``` and a seperate ```xUnit.core``` test project (for integration testing of Web API). For both Development and xUnit tests I am using the ```InMemory``` database option with ```Entity Framework Core``` for convienence
1818

1919
## Setup
2020
1. Install the following (or confirm installed):
@@ -23,7 +23,7 @@ Prototype application with a Vue.js client that has significant unit testing cov
2323
2. After cloning the repo, run the command ```npm install``` in the ```ClientApp``` directory to restore all Node packages/dependencies from package.json
2424
3. Open the .sln solution in Visual Studio and make sure all dependencies and Nuget dependencies are installed/restored - won't hurt to rebuild the entire solution (both projects)
2525
4. Two potential ways to start the entire project:
26-
- I installed and configured the [`aspnetcore-vueclimiddleware`](https://github.com/EEParker/aspnetcore-vueclimiddleware) in the FullStackTesting.Web.Api project - in theory this makes things easier by allowing you to launch the Web Api and the Vue.js client from within Visual Studio by just running the project. I found its functionality to be spotty when used with .NET Core 2.x, however, after upgrading to .NET Core 3.1 and bump the Nugtet package to the 3.1 version I encountered zero issues.
26+
- I installed and configured the [`aspnetcore-vueclimiddleware`](https://github.com/EEParker/aspnetcore-vueclimiddleware) in the FullStackTesting.Web.Api project - in theory this makes things easier by allowing you to launch the Web Api and the Vue.js client from within Visual Studio by just running the project. I found its functionality to be spotty when used with .NET Core 2.x, however, after upgrading to .NET 5.0 and bump the Nuget package to the 5.0 version I encountered zero issues.
2727

2828

2929
```csharp
@@ -33,9 +33,19 @@ app.UseEndpoints(endpoints => {
3333
endpoints.MapControllers();
3434

3535
if (System.Diagnostics.Debugger.IsAttached)
36-
endpoints.MapToVueCliProxy("{*path}", new SpaOptions { SourcePath = _spaSourcePath }, "serve", regex: "running at");
36+
{
37+
endpoints.MapToVueCliProxy(
38+
"{*path}",
39+
new SpaOptions { SourcePath = _spaSourcePath },
40+
npmScript: "serve",
41+
regex: "running at",
42+
forceKill: true
43+
);
44+
}
3745
else
46+
{
3847
endpoints.MapFallbackToFile("index.html");
48+
}
3949
});
4050
```
4151

0 commit comments

Comments
 (0)