我在测试时对nodejs进行了测试,我得到了未声明的完成函数的错误.
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
Run Code Online (Sandbox Code Playgroud)
我的测试代码是,我已完成回调但仍然收到错误来调用 done();
it('remove existing subdocument', (done) => {
const Vic = new User({
name: 'Vic',
posts: [{ title: 'Leaning Nodejs' }]
});
vic.save()
.then(() => User.findOne({ name: 'Vic' }))
.then((user) => {
const post = user.posts[0];
post.remove();
return user.save();
})
.then(() => User.findOne({ name: 'Vic' }))
.then((user) => {
assert(user.posts.length === 0);
done();
});
});
Run Code Online (Sandbox Code Playgroud) 我使用角度4和材质2处理Web应用程序.我收到此错误
parse errors:
'md-card' is not a known element:
1. If 'md-card' is an Angular component, then verify that it is part of this module.
2. If 'md-card' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("<h2>Nothing to show</h2>
[ERROR ->]<md-card>Simple card</md-card>
"): ng:///AppAccessModule/SPLoginComponent.html@1:0
at syntaxError
Run Code Online (Sandbox Code Playgroud)
当我尝试在一个文件夹内嵌套两次的组件中使用材料时
这些是我的结构:
-----Components(folder)
-------Auth(folder)
--------Login(component1)
--------Signup(component2)
Run Code Online (Sandbox Code Playgroud)
但如果我下一次喜欢这样:
-------Auth(folder)
--------Login(component 1)
--------Signup(component2)
Run Code Online (Sandbox Code Playgroud)
我没有任何问题我该怎么做才能解决这个问题?谢谢
升级到离子和离子角度的最新模块后,我得到了这个错误.这是我升级后的Package.json文件..
这是我升级后的Package.json文件..
运行时错误
Module parse failed: Unexpected token (84:1254) You may need an appropriate loader to handle this file type. | HomelistPage = __decorate([ | Component({ | selector: 'page-homelist',template:/*ion-inline-start:"/Users/macbook/Downloads/studio/src/pages/home/homelist/homelist.html"*/`<ion-header>\n <ion-navbar color="bluegray">\n <button ion-button menuToggle color="light">\n <ion-icon name="menu"></ion-icon>\n </button>\n <ion-title color="light">Instractors</ion-title>\n <ion-buttons right>\n <button color="light" ion-button icon-only (click)="createMessage()">\n <ion-icon name="more"></ion-icon>\n </button>\n </ion-buttons>\n </ion-navbar>\n <ion-toolbar color="bluegray">\n <ion-searchbar></ion-searchbar>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n <!--*********** 2 colomns list ***********-->\n <ion-grid>\n <ion-row wrap>\n <ion-col tappable col-6 *ngFor="let item of items" (click)="goToDetail(item.$key)" color="gray">\n <ion-card class="cardList">\n <div *ngIf="item.discount" class="ribbon pop-in">SALE</div>\n <img …Run Code Online (Sandbox Code Playgroud) 我有这个数组["one","two","three"]想把它转换成这个{one:true, two:true, three:true}。基本上我正在做的是将数组项转换为对象的键并使它们成为布尔值。我试过使用传播运算符{... arr},结果是{0:'one',1:'two',2:'three'},有什么想法吗?