gpt4 book ai didi

unit-testing - Electron 项目上的docker volume文件夹的Ava和权限

转载 作者:行者123 更新时间:2023-12-03 12:35:04 26 4
gpt4 key购买 nike

我的项目包含以下文件,并具有各自的权限:

-rw-r--r--   1 pcmagas pcmagas    761 Νοέ  20 18:08 .compilerc
-rw-rw-r-- 1 pcmagas pcmagas 1034 Νοέ 23 19:11 docker-compose.yml
-rw-rw-r-- 1 pcmagas pcmagas 334 Νοέ 20 22:32 docker-entrypoint.sh
-rw-rw-r-- 1 pcmagas pcmagas 716 Νοέ 20 22:13 Dockerfile
-rw-rw-r-- 1 pcmagas pcmagas 67 Νοέ 23 22:53 .dockerignore
drwxrwxr-x 2 pcmagas pcmagas 4096 Δεκ 28 18:55 dummy_src
-rw-r--r-- 1 pcmagas pcmagas 216 Νοέ 20 18:05 .eslintrc
drwxrwxr-x 9 pcmagas pcmagas 4096 Δεκ 31 14:34 .git
-rw-r--r-- 1 pcmagas pcmagas 35 Νοέ 23 22:53 .gitignore
-rw-rw-r-- 1 pcmagas pcmagas 127 Νοέ 23 19:06 .gitmodules
drwxrwxr-x 686 pcmagas pcmagas 36864 Δεκ 31 14:34 node_modules
-rw-rw-r-- 1 pcmagas pcmagas 1598 Δεκ 31 14:34 package.json
-rw-rw-r-- 1 pcmagas pcmagas 308707 Δεκ 31 14:34 package-lock.json
drwxrwxr-x 4 pcmagas pcmagas 4096 Δεκ 30 17:58 src
drwxrwxr-x 3 pcmagas pcmagas 4096 Νοέ 23 19:06 submodules
drwxrwxr-x 2 pcmagas pcmagas 4096 Δεκ 9 15:38 test
-rw-rw-r-- 1 pcmagas pcmagas 348 Δεκ 7 18:55 test.js
drwxr-xr-x 3 root root 4096 Νοέ 23 19:13 volumes
drwxrwxr-x 2 pcmagas pcmagas 4096 Νοέ 23 21:43 .vscode

test文件夹中,我具有以下测试文件:

从ava导入测试;

test('true't => {
t.pass(“为了使ava运行而进行的硬编码的通过测试”)
});

我已经基于 https://spectrum.chat/?t=d5e89afe-9a3c-4222-a5c6-d6322eb5fcec)和stackoverflow问题像这样配置了ava: Ava split tests Into multiple files
"ava": {
"files": [
"./test",
"!./volumes",
"!./submodules"
],
"sources": "./src/**/*.{js,jsx}"
},

但是,当我运行测试时,出现以下错误:
> custom_xmpp@1.0.0 test /home/pcmagas/Kwdikas/master_thesis/custom_xmpp
> ava


⠋ glob error { [Error: EACCES: permission denied, scandir '/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/volumes/openfire/__tests__/helpers']
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path:
'/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/volumes/openfire/__tests__/helpers' }
glob error { [Error: EACCES: permission denied, scandir '/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/volumes/openfire/__tests__']
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path:
'/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/volumes/openfire/__tests__' }
glob error { [Error: EACCES: permission denied, scandir '/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/volumes/openfire/test/helpers']
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path:
'/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/volumes/openfire/test/helpers' }
⠙ ✖ Internal errorglob error { [Error: EACCES: permission denied, scandir '/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/volumes/openfire/test']
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path:
'/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/volumes/openfire/test' }


✖ Internal error
Error: EACCES: permission denied, scandir '/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/volumes/openfire/__tests__/helpers'
Error: EACCES: permission denied, scandir '/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/volumes/openfire/__tests__/helpers'
at handlePaths (/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/node_modules/ava/lib/ava-files.js:13:18)
at AvaFiles.findTestHelpers (/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/node_modules/ava/lib/ava-files.js:144:10)
at emittedRun.then.then.precompilation (/home/pcmagas/Kwdikas/master_thesis/custom_xmpp/node_modules/ava/api.js:151:9)

npm ERR! Test failed. See above for more details.

我做错了什么?

最佳答案

不幸的是,AVA还会寻找帮助文件。您目前无法配置这些目录模式。但是,如果禁用AVA的测试文件和帮助文件的编译,则该问题将消失。参见https://github.com/avajs/ava/blob/master/docs/recipes/babel.md#disable-avas-babel-pipeline

关于unit-testing - Electron 项目上的docker volume文件夹的Ava和权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53987824/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com