小编Ach*_*yut的帖子

无法在目录中运行程序"npm"

当我遍历到src/main/app/我拥有package.JSON&gruntfile的文件夹结构时,我能够运行npm install并grunt命令.但是当我尝试mvn jetty:run在POM文件存在时运行项目的根文件夹中的属性文件时,它会抛出错误,它无法npm install在文件夹结构中运行src/main/app/.

这是确切的错误:

[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (n
pminstall) on project my-abc-web: Command execution failed. Cannot
 run program "npm" (in directory "C:\Users\Achyut_J01\Documents\GitHub\infras\my-abc\my-abc-web\src\main\app"): CreatePro
cess error=2, The system cannot find the file specified -> [Help 1]
Run Code Online (Sandbox Code Playgroud)

这是一台Windows机器.

maven node.js gruntjs

13
推荐指数
3
解决办法
3万
查看次数

Nest JS - 为返回 Observable Axios 响应的函数编写 Jest 测试用例的问题

我对 NestJS + Typescript + RxJs 技术堆栈相当陌生。我正在尝试使用 Jest 为我的功能之一编写单元测试用例,但不确定是否正确执行。

组件.service.ts

public fetchComponents(queryParams) {
  const url = this.prepareUrl(queryParams);

  const data$ = this.httpService.get(url);

  return data$
    .pipe(map(({ data }) => data));
}
Run Code Online (Sandbox Code Playgroud)

组件.服务.spec.ts

测试用例有效并通过

describe('fetchComponents', () => {
  const query = {
    limit: 10,
    offset: 0
  };

  const result: AxiosResponse = {
    data: 'Components',
    status: 200,
    statusText: 'OK',
    headers: {},
    config: {}
  };
  it('should return Dummy Data when called successfully', () => {
    componentService.prepareUrl = jest.fn();

    jest.spyOn(httpService, 'get').mockImplementation(() => of(result));

   componentService.fetchComponents(market, query)
    .subscribe( …
Run Code Online (Sandbox Code Playgroud)

node.js rxjs typescript jestjs nestjs

5
推荐指数
1
解决办法
3662
查看次数

标签 统计

node.js ×2

gruntjs ×1

jestjs ×1

maven ×1

nestjs ×1

rxjs ×1

typescript ×1