-
Notifications
You must be signed in to change notification settings - Fork 11
/
Rakefile
31 lines (24 loc) · 751 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require 'bundler'
Bundler.require
require 'bundler/gem_tasks'
task :test do
require 'opal'
require 'opal/cli_runners'
require 'opal/minitest'
Opal::Config.arity_check_enabled = true
Opal::Config.dynamic_require_severity = :warning
Opal.append_path 'opal'
Opal.append_path 'test'
builder = Opal::Builder.new
builder.build 'opal'
builder.build 'opal/platform'
builder.build 'minitest'
Dir['test/**/*_test.rb'].map do |file|
builder.build file.sub(%r{^test/}, '')
end
builder.build_str 'Minitest.run', 'minitest-runner.rb'
runner_name = ENV['RUNNER'] || 'nodejs'
runner_class = Opal::CliRunners.const_get(runner_name.capitalize)
runner_class.new(output: $stdout).run(builder.to_s, [])
end
task default: :test