File tree Expand file tree Collapse file tree 1 file changed +13
-16
lines changed Expand file tree Collapse file tree 1 file changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -24,20 +24,16 @@ def install
2424 end
2525
2626 test do
27- foo_test_file = testpath /"foo.js"
28- foo_test_file . write "import { bar } from './bar'"
29-
30- bar_test_file = testpath /"bar.js"
31- bar_test_file . write "export const bar = 'bar'"
32-
33- package_json_file = testpath /"package.json"
34- package_json_file . write "{ \" name\" : \" foo\" }"
35-
36- result_file = testpath /"out.json"
37- output = shell_output ( "#{ bin } /dep-tree tree --json #{ foo_test_file } " )
38- result_file . write ( output )
39-
40- expected = <<~EOF
27+ ( testpath /"foo.js" ) . write <<~JS
28+ import { bar } from './bar'
29+ JS
30+ ( testpath /"bar.js" ) . write <<~JS
31+ export const bar = 'bar'
32+ JS
33+ ( testpath /"package.json" ) . write <<~JSON
34+ { "name": "foo" }
35+ JSON
36+ expected = <<~JSON
4137 {
4238 "tree": {
4339 "foo.js": {
@@ -47,7 +43,8 @@ def install
4743 "circularDependencies": [],
4844 "errors": {}
4945 }
50- EOF
51- assert_equal expected , result_file . read
46+ JSON
47+
48+ assert_equal expected , shell_output ( "#{ bin } /dep-tree tree --json #{ testpath } /foo.js" )
5249 end
5350end
You can’t perform that action at this time.
0 commit comments