我的项目包含在具有相应权限的以下文件中:
-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 split tests Into multiple files
来配置了ava,"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.
我做错了什么?
答案 0 :(得分:1)
不幸的是,AVA还会查找帮助文件。您目前无法配置这些目录模式。但是,如果禁用AVA的测试文件和帮助文件的编译,则该问题将消失。参见https://github.com/avajs/ava/blob/master/docs/recipes/babel.md#disable-avas-babel-pipeline。