Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Aug 11, 2021
1 parent d29acb0 commit 000173c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lib/src/node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ JsError _wrapException(Object exception) {
var url = exception.span.sourceUrl;
if (url == null) {
file = 'stdin';
} else if (url.scheme == 'file') {
file = p.fromUri(url);
} else {
file = url.toString();
}
} else if (url.scheme == 'file') {
file = p.fromUri(url);
} else {
file = url.toString();
}

return _newRenderError(exception.toString().replaceFirst("Error: ", ""),
line: exception.span.start.line + 1,
Expand Down
12 changes: 6 additions & 6 deletions test/node_api/importer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -706,14 +706,14 @@ void main() {
});

test("it occurs in a file with a custom URL scheme", () {
var error =
renderSyncError(RenderOptions(
data: "@import 'foo:bar'",
importer: allowInterop(expectAsync2((String _, void __) {
return NodeImporterResult(contents: '@error "oh no";');
var error = renderSyncError(RenderOptions(
data: "@import 'foo:bar'",
importer: allowInterop(expectAsync2((String _, void __) {
return NodeImporterResult(contents: '@error "oh no";');
}))));

expect(error,
expect(
error,
toStringAndMessageEqual("\"oh no\"\n"
" ╷\n"
"1 │ @error \"oh no\";\n"
Expand Down

0 comments on commit 000173c

Please sign in to comment.