fix(devcontainer): make it possible to run mocha tests in VSCode using different extension

Indeed https://github.com/maty21/mocha-sidebar/issues/181#issuecomment-1016768595 seems to work and pointed me to a better extension.
This works better than maty.vscode-mocha-sidebar which could not find nyc.
This commit is contained in:
rugk
2026-02-23 14:44:21 +00:00
parent 47c986a781
commit 809a79bd3e
4 changed files with 23 additions and 20 deletions

View File

@@ -4,22 +4,18 @@
"customizations": {
"vscode": {
"extensions": [
"github.codespaces",
// PHP from https://github.com/devcontainers/templates/tree/main/src/php
"xdebug.php-debug",
"bmewburn.vscode-intelephense-client",
"xdebug.php-pack",
// PHP
"DEVSENSE.phptools-vscode",
"DEVSENSE.composer-php-vscode",
// linting
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint",
"raymondcamden.CSSLint",
// testing
"maty.vscode-mocha-sidebar",
"recca0120.vscode-phpunit"
]
"github.codespaces",
"xdebug.php-debug",
"bmewburn.vscode-intelephense-client",
"xdebug.php-pack",
"DEVSENSE.phptools-vscode",
"DEVSENSE.composer-php-vscode",
"EditorConfig.EditorConfig",
"dbaeumer.vscode-eslint",
"raymondcamden.CSSLint",
"recca0120.vscode-phpunit",
"hbenl.vscode-mocha-test-adapter"
]
},
"codespaces": {
"openFiles": [

View File

@@ -15,6 +15,10 @@ composer install --no-dev --optimize-autoloader
composer global require phpunit/phpunit
composer global require google/cloud-storage
sudo chmod a+x "$(pwd)" && sudo rm -rf /var/www/html && sudo ln -s "$(pwd)" /var/www/html
# for JS testing
JAVASCRIPT_DIRECTORY="$(pwd)/js"
npm --prefix "$JAVASCRIPT_DIRECTORY" install "$JAVASCRIPT_DIRECTORY"
npm install --global nyc
# development webserver
sudo chmod a+x "$(pwd)" && sudo rm -rf /var/www/html && sudo ln -s "$(pwd)" /var/www/html

View File

@@ -2,6 +2,7 @@
"recommendations": [
"recca0120.vscode-phpunit",
"onecentlin.phpunit-snippets",
"devsense.profiler-php-vscode"
"devsense.profiler-php-vscode",
"spoonscen.es6-mocha-snippets"
]
}

View File

@@ -8,5 +8,7 @@
"${workspaceFolder}/tst/phpunit.xml",
"--bootstrap",
"${workspaceFolder}/tst/Bootstrap.php"
]
],
"mochaExplorer.pkgFile": "js/package.json",
"mochaExplorer.files": "js/test/*.js",
}