我正在尝试将基本的角度骨架应用程序从Angle 5升级到Angle 6,这是我在尝试运行该应用程序时遇到的问题:
ERROR in node_modules/rxjs-compat/operator/shareReplay.d.ts(2,10): error TS2305: Module '"C:/newAdmin/testing-front-end/admin-fe/node_modules/rxjs/internal-compatibility/index"' has no exported member 'ShareReplayConfig'.
Run Code Online (Sandbox Code Playgroud)
这是我的package.json:
{
"name": "admin-fe",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular-devkit/core": "^7.3.0",
"@angular/animations": "^6.1.0",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"@ngrx/store": "^7.2.0",
"angular-oauth2-oidc": "^5.0.2",
"core-js": "^2.5.4",
"moment": "^2.24.0",
"rxjs": "6.3.3",
"rxjs-compat": "^6.4.0",
"zone.js": "~0.8.26"
}, …Run Code Online (Sandbox Code Playgroud) 当从Angular 7应用程序的karma-jasmine切换到jest时,出现以下错误:
Validation Error:
Module <rootDir>/node_modules/jest-preset-angular/preprocessor.js in the transform option was not found.
<rootDir> is: C:\newAdminJestTest\jest-angular-example
Configuration Documentation:
https://jestjs.io/docs/configuration.html
Run Code Online (Sandbox Code Playgroud)
我一直在按照本指南进行切换:https : //blog.skarby.info/jest-with-angular/
如果我从中的笑话对象中删除了transform属性,则测试用例似乎运行良好package.json。但是,使用transform属性运行时出现上述错误。
这是我的package.json:
{
"name": "jest-angular-example",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "jest",
"test:watch": "jest --watch",
"test:ci": "jest -ci --runInBand",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~7.2.0",
"@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0",
"@angular/forms": "~7.2.0",
"@angular/platform-browser": "~7.2.0",
"@angular/platform-browser-dynamic": "~7.2.0",
"@angular/router": "~7.2.0", …Run Code Online (Sandbox Code Playgroud) 我目前有一个网页点击网络服务来发送多部分/表单数据,但不知何故,这些字段没有被附加到表单数据对象中。有人可以帮我吗?
索引.html
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8"></meta>
<title>Sample upload</title>
<script type="text/javascript" src="webjars/jquery/3.2.1/jquery.min.js">
</script>
<script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js">
</script>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
/>
<script>
$(document).ready(function () {
$("#btnSubmit").click(function (event) {
//stop submit the form, we will post it manually.
event.preventDefault();
fire_ajax_submit();
});
});
function fire_ajax_submit() {
// Get form
var form = $('#dataform')[0];
var data = new FormData(form);
data.append("CustomField", "This is some extra data, testing");
$("#btnSubmit").prop("disabled", true);
$.ajax({
type: "POST",
enctype: 'multipart/form-data',
url: "/save",
data: data,
//http://api.jquery.com/jQuery.ajax/
//https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
processData: false, //prevent jQuery from …Run Code Online (Sandbox Code Playgroud) angular ×2
ajax ×1
angular-cli ×1
angular7 ×1
java ×1
javascript ×1
jestjs ×1
rest ×1
rxjs ×1
spring-boot ×1
typescript ×1
unit-testing ×1