The following command works as expected:
protractor --cucumberOpts.tags='not #tag1' conf.js
Now I want to add this command as a script to package.json like this:
"scripts": {
"my-script": "protractor --cucumberOpts.tags='not #tag1' conf.js"
}
Running the command npm run my-script gives me the following error:
Usage: protractor [configFile] [options]
configFile defaults to protractor.conf.js
The [options] object will override values from the config file.
See the reference config for a full list of options.
Options:
...
Error: Error: more than one config file specified
Why is that?
Both of the commands seem to be identical.
This is not actually a protractor issue. I was able to recreate this issue and resolved it by using escaped doubles quotes in that script string like so.
"scripts": {
"my-script": "protractor --cucumberOpts.tags=\"not #tag1\" conf.js"
}
This issue (apparently) is to do with how node handles single quotes on different operating systems. There is some more info in this question.
Related
The purpose is to debug only one unit test in the exs file, therefore it is necessary to ignore other unit tests in the same exs file.
My previous solution is comment out the other unit test, but the bad side of this solution is I can't find other unit tests easily through vscode's outline view as follows:
From the mix doc, it is found that mix command has --include and --only option.
I have adjusted launch.json file as follows, update task args as --trace --only :external, and update the exs file, but when runing mix test, it gives the error message.
Remember to keep good posture and stay hydrated!
helloworld
(Debugger) Task failed because an exception was raised:
** (Mix.Error) Could not invoke task "test": 1 error found!
--trace --only :external : Unknown option
(mix 1.13.4) lib/mix.ex:515: Mix.raise/2
(elixir_ls_debugger 0.10.0) lib/debugger/server.ex:1119: ElixirLS.Debugger.Server.launch_task/2
Then I changed launch.json to "--trace --only :external", similar error message as follows:
(Debugger) Task failed because an exception was raised:
** (Mix.Error) Could not invoke task "test": 1 error found!
--trace --only :external : Unknown option
(mix 1.13.4) lib/mix.ex:515: Mix.raise/2
(elixir_ls_debugger 0.10.0) lib/debugger/server.ex:1119: ElixirLS.Debugger.Server.launch_task/2
I use a plugin called Elixir Test. It has a few nice features including what you are asking for.
To run a single test place your cursor within the code of the test, then select "Elixir Test: Run test at cursor" from the command palette.
Another helpful command is: "Elixir Test: Jump". If you are editing a module file, this command will jump to the test file corresponding to the module. It will optionally create the skeleton for the test file if you haven't created it yet.
It is caused by syntax problem. Every paremeter should be one element as follows:
"taskArgs": [
"--trace", "--warnings-as-errors", "--only", "external"
],
SUCCESS
I start PowerShell from the File explorer: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe. I change directory to where I want to run the yarn command. I run yarn build which starts the script rollup --config --environment NODE_ENV:production. The application builds successfully.
FAIL
I start PowerShell from the start menu: C:\Users\Me\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk. This shortcut targets the executable above: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe. I change directory to where I want to run the yarn command. I run yarn build. The build errors.
src/renderer/renderer.tsx → app/build...
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
src\renderer\renderer.tsx (6:9)
4:
5: document.addEventListener("DOMContentLoaded", () =>
6: render(<App />, document.getElementById("root"))
^
7: );
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
at error (C:\Users\Me\Dev\graphics\svgconverter\node_modules\rollup\dist\shared\rollup.js:217:30)
at Module.error (C:\Users\Me\Dev\graphics\svgconverter\node_modules\rollup\dist\shared\rollup.js:15145:16)
at tryParse (C:\Users\Me\Dev\graphics\svgconverter\node_modules\rollup\dist\shared\rollup.js:15034:23)
at Module.setSource (C:\Users\Me\Dev\graphics\svgconverter\node_modules\rollup\dist\shared\rollup.js:15436:30)
at ModuleLoader.addModuleSource (C:\Users\Me\Dev\graphics\svgconverter\node_modules\rollup\dist\shared\rollup.js:17434:20)
at ModuleLoader.fetchModule (C:\Users\Me\Dev\graphics\svgconverter\node_modules\rollup\dist\shared\rollup.js:17495:9)
at async Promise.all (index 0)
at async Promise.all (index 0)
error Command failed with exit code 1.
LOOKING FOR DIFFERENCES
I have checked the file properties of the shortcut. It does not open the target as administrator. The owner is EUR/{Me}. System, Me and Administrators have all permissions checked except for special permissions. I think this is should not lead to any difference in behavior from starting PowerShell without using this shortcut?
I have printed the environment variables on both shells using dir env: | Format-Table -Wrap and they are completely equal.
So now I am scratching my head. What could possibly explain the difference?
My goal is to use bcftools to check that the reference alleles in my dataset (vcf file) match with a reference genome (fasta file) using the fixref plugin.
Working on command line, I first set the following environment:
export BCFTOOLS_PLUGINS=/path/to/bcftools/plugins
The following code is recommended for test datasets with mismatches:
bcftools +fixref test.bcf -Ob -o output.bcf -- -f ref.fa -m top
When I run this code using my own files (please note that my data is .vcf, not .bcf) I get the following error:
[main] Unrecognized command
If I simply enter:
bcftools
I get a list of the only 5 commands (view, index, cat, ld, ldpair) that I can use. So although I've set the environment, does it somehow need to be activated? Do I need to run my command through a bash script?
bcftools
was pointing to a deprecated version of bcftools (0.1.19) in ../bin/, while
BCFTOOLS_PLUGINS=/path/to/bcftools/plugins
was pointing to the plugins for bcftools version 1.10.2 outside /bin/
Replacing ../bin/bcftools (0.1.19 with 1.10.2) was the fix.
I'm trying to use coffeeify with budo so I do not have to add the extension to my require statements. I have tried passing these commands through budo's browserify options
budo src/app.coffee --live --serve bundle.js -- -t coffeeify --extension=".coffee"
budo src/app.coffee --live --serve bundle.js -- -t [coffeeify --extension=".coffee"]
I also tried inserting the browserify transform into my package.json
"browserify: {
"transform": ["coffeeify", {"extension": ".coffee"}]
}
Here is something that works for me (took me forever to figure it out, the hard part being getting watchify to work with coffeescript). Everything is in the package.yaml. Invoke npm start from your top folder and it will do the trick. npm puts all the locally installed node binaries in your PATH for you (they normally live under node_modules/.bin).
{
"name": "my-package",
"version": "1.0.0",
"private": true,
"scripts": {
"start": "(cd src; budo app.coffee:bundle.js --dir . --live --verbose -- --extension=.coffee | garnish)"
},
"browserify": {
"extension": [ ".coffee" ],
"transform": [ ["coffeeify"], ["brfs"] ]
},
"devDependencies": {
"brfs": "1.4.1",
"browserify": "11.1.0",
"budo": "^5.1.5",
"coffee-script": "latest",
"coffeeify": "^1.1.0",
"garnish": "^3.2.1",
"watchify": "3.4.0"
}
}
I have my source code under the src folder, and a file named app.coffee which includes (or require in node.js terms) my whole application. I have an index.html in my src folder which reference the bundle.js through from an html script tag.
The command to start budo is inside my package.json. It does cd into my src folder first.
The trick is to specify some configuration in the browserify block: the extension .coffee needs to be present, and a list of transforms as well. I tried to have everything on the command line but never got it to work
After npm start is invoked, since I pass the --live argument to budo everything works like magic and edit/saves to my documents do trigger a browser reload/refresh.
To deploy or release you'll probably need another target to minify with uglify.js. I still have a script that does that manually in 2 steps, the first step calls browserify and the second step calls uglify.js explicitely.
As a remark, recent version of budo do the piping into garnish for you I've heard.
Another tip is to look at what the React folks are doing to transform their .jsx files, as it is in theory extremely close to what the coffeescript folks need to do. There seems to be a huge momentum around React so hopefully React people will have figured those build problems first.
I've been able to get JSDoc3 working with the default template, however, when I try to run another template (even the one that comes with it,haruki) I get the following error:
js: "/path/to/jsdoc/jsdoc.js", line 308: exception from uncaught JavaScript throw: Error: Unable to load template: Module "haruki/publish" not found.
I've tried several other templates and get the same thing. Goven my freshman status with JSDoc I'm assuming it's some config or call issue that's tripping me up.
try to set full path to template folder with publish.js file (not only template name)
for example command line parameter
-t templates/docstrap-master/template
or in config.json file
{ ...
"opts": {
...
"template": "templates/docstrap-master/template"
}
}
it works for this https://github.com/terryweiss/docstrap
for Haruki it seems to work too ./jsdoc -c conf.json -t templates/haruki but i have another error:
This template only supports output to the console. Use the option "-d
console" when you run JSDoc.
With -d console it prints result to console