Class: Brut::CLI::Apps::Test::Js
Instance Attribute Summary
#parent_command
Instance Method Summary
collapse
#accepts, #args_description, #argv, #bootstrap?, #commands, #delegate_to_command, #env, #env_vars, #execute, #name, #options, #puts, #stdin, #system!, #theme
Instance Method Details
#default_rack_env ⇒ Object
113
|
# File 'lib/brut/cli/apps/test.rb', line 113
def default_rack_env = "development"
|
#description ⇒ Object
114
|
# File 'lib/brut/cli/apps/test.rb', line 114
def description = "Run JavaScript unit tests"
|
#detailed_description ⇒ Object
118
119
120
|
# File 'lib/brut/cli/apps/test.rb', line 118
def detailed_description = %{
Runs all JavaScript unit tests for the app. This does not support running individual tests.
}
|
#opts ⇒ Object
115
116
117
|
# File 'lib/brut/cli/apps/test.rb', line 115
def opts = [
[ "--[no-]build-assets","Build all assets before running the tests" ],
]
|
#run ⇒ Object
122
123
124
125
126
127
128
129
130
131
|
# File 'lib/brut/cli/apps/test.rb', line 122
def run
options.set_default(:"build-assets", true)
if options.build_assets?
Bundler.with_unbundled_env do
system!({ "RACK_ENV" => "test" }, "brut build-assets all")
end
end
execution_context.executor.system!({ "NODE_DISABLE_COLORS" => "1" },"npx mocha #{Brut.container.js_specs_dir} --no-color --extension 'spec.js' --recursive")
0
end
|