我在Mac High Sierra上使用npm@5.6.0.我想运行在此Stratum客户端项目中设置的测试.我已经npm install成功运行了.但是当我尝试运行单个测试时,我收到错误:
no test specified
Run Code Online (Sandbox Code Playgroud)
是什么赋予了?我在根项目目录中,测试在我的"test"文件夹中.这是发生的事情:
localhost:stratum-client-master davea$ npm install
up to date in 0.381s
localhost:stratum-client-master davea$ npm test test/callbacks.js
> stratum-client@1.0.1 test /Users/davea/Documents/workspace/stratum-client-master
> echo "Error: no test specified" && exit 1 "test/callbacks.js"
Error: no test specified
sh: line 0: exit: too many arguments
npm ERR! Test failed. See above for more details.
Run Code Online (Sandbox Code Playgroud) 我正在尝试HttpClient在Angular 7中使用JSON .代码工作正常,但我正在尝试实现注释代码并停止使用CONST IMAGES并直接从api获取此数据,我还不能这样做.
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
@Injectable()
export class ImageService {
// public _url: string = "https://jsonplaceholder.typicode.com/photos";
constructor(
// public http: HttpClient
) {}
theImages = [];
// IMAGES = [];
getImages(){
// this.IMAGES = this.http.get(this._url);
return this.theImages = IMAGES.slice(0);
}
getImage(id: number){
// this.IMAGES = this.http.get(this._url);
return IMAGES.slice(0).find(image => image.id == id);
}
}
const IMAGES = [
{
"albumId": 1,
"id": 1,
"title": "accusamus …Run Code Online (Sandbox Code Playgroud) typescript angular2-observables angular angular-httpclient angular7