Created
January 18, 2019 07:26
-
-
Save pascalw/013a6b79658bb347ad1d3a26469c2ae1 to your computer and use it in GitHub Desktop.
VSCode Elixir umbrella app tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
test_file = ARGV[0] | |
line_no_arg = ARGV[1] | |
parts = test_file.scan(/.*apps\/(.*?)\/(.*)/).last | |
app = parts[0] | |
test_file_relative = parts[1] | |
line_no = line_no_arg ? ":#{line_no_arg}" : "" | |
exec("cd $(git rev-parse --show-toplevel)/apps/#{app} && mix test #{test_file_relative}#{line_no}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"label": "Run all tests", | |
"type": "shell", | |
"command": "clear; ./script/mix-test-wrapper.rb ${relativeFile}", | |
"problemMatcher": [ | |
"$mixCompileError", | |
"$mixCompileWarning", | |
"$mixTestFailure" | |
] | |
}, | |
{ | |
"label": "Run current test", | |
"type": "shell", | |
"command": "clear; ./script/mix-test-wrapper.rb ${relativeFile} ${lineNumber}", | |
"problemMatcher": [ | |
"$mixCompileError", | |
"$mixCompileWarning", | |
"$mixTestFailure" | |
], | |
"group": { | |
"kind": "test", | |
"isDefault": true | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment