简体   繁体   English

Wallaby.js 不工作(无法从 'node_modules/cpm-config.app.js' 中找到模块 '../../config-test.json')

[英]Wallaby.js not working (Cannot find module '../../config-test.json' from 'node_modules/cpm-config.app.js')

I have join a new organization recently, and I am trying to configure my machine.我最近加入了一个新组织,我正在尝试配置我的机器。

As I am a huge fan of Wallaby.js, I'd like to make it work on my setup.由于我是 Wallaby.js 的忠实粉丝,我想让它在我的设置中运行。

But I can't set the env params correctly.但我无法正确设置环境参数。

Here is my wallaby.js file:这是我的wallaby.js文件:

'use strict'

module.exports = function () {
    process.env.NODE_ENV = 'ci'
    return {
        files: ['src/**/*.js'],

        tests: ['tests/**/*Spec.js'],
        env: {
            type: 'node',
        },
    }
}

I guess you already solved your problem but in case somebody has the same.我猜你已经解决了你的问题,但万一有人有同样的问题。 The problem comes from the configuration you have a wallaby.js Done like that means that wallaby will only consider js files with this pattern: tests/**/*Spec.js问题来自你有一个wallaby.js的配置 这样做意味着wallaby 只会考虑具有这种模式的js文件: tests/**/*Spec.js

Since your configuration file do not have Spec in the name it is not loaded by wallaby.js由于您的配置文件的名称中没有 Spec 它不是由wallaby.js加载的

To fix that simply put this as a pattern for the test files: tests/**/*.js要解决这个问题,只需将其作为测试文件的模式: tests/**/*.js

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到模块“./*.env”节点js - Cannot find module './*.env' node js PM2 集群模式 - 找不到模块 'dotenv/config' - PM2 Cluster Mode - Cannot find module 'dotenv/config' node.js 中的 require('dotenv').config() - require('dotenv').config() in node.js 无法访问 nuxt.config.js 中的 env - cannot access env inside nuxt.config.js 最佳实践 - 本地 Node.js (*.env) 到远程 Azure 应用服务(配置设置) - Best practices - Local Node.js (*.env) to remote Azure app service (config settings) 使用环境变量引用Node.js中的本地文件(与node_modules一起存储) - Reference a local file (stored alongside node_modules) within Node.js with Environment Variables Vue.js e2E测试Nightwatch:无论如何都要使用特定的config.test.js进行测试 - Vue.js e2E tests Nightwatch : anyway to run the test with a specific config.test.js Bamboo 构建失败,因为 webpack dones 找不到 node_modules - Bamboo build fails because webpack donesn't find node_modules 节点process.env安装程序不适用于npm配置库 - Node process.env setup not working on npm config library 如何在 gatsby-config.js 中使用 AWS Amplify 环境变量? - How to use AWS Amplify env vars in gatsby-config.js?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM