Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Node tests on Windows to Travis #1063

Merged
merged 4 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,10 @@ jobs:
# The versions should be kept up-to-date with the latest LTS Node releases.
# They next need to be rotated April 2021. See
# https://github.com/nodejs/Release.
#
# TODO(nweiz): Run Node tests on Windows when [this issue][] is fixed.
#
# [this issue]: https://travis-ci.community/t/windows-instances-hanging-before-install/250/28.
- &node-tests
name: Node tests | Dart stable | Node stable
language: node_js
node_js: lts/*
node_js: node
install: pub run grinder before-test
script: tool/travis/task/node_tests.sh
- <<: *node-tests
Expand All @@ -89,6 +85,8 @@ jobs:
- <<: *node-tests
name: Node tests | Dart stable | Node Erbium
node_js: lts/erbium
- <<: *node-tests
os: windows
- <<: *node-tests
os: osx
- <<: *node-tests
Expand Down
21 changes: 0 additions & 21 deletions appveyor.yml

This file was deleted.

9 changes: 5 additions & 4 deletions test/node_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import 'hybrid.dart';
import 'node_api/api.dart';
import 'node_api/intercept_stdout.dart';
import 'node_api/utils.dart';
import 'utils.dart';

String sassPath;

Expand Down Expand Up @@ -294,7 +295,7 @@ a {
"1 │ x {y: }\n"
" │ ^\n"
" ╵\n"
" $sassPath 1:7 root stylesheet"));
" ${prettyPath(sassPath)} 1:7 root stylesheet"));
});
});

Expand Down Expand Up @@ -369,7 +370,7 @@ a {
"1 │ a {b: }\n"
" │ ^\n"
" ╵\n"
" $sassPath 1:7 root stylesheet"));
" ${prettyPath(sassPath)} 1:7 root stylesheet"));
});

test("sets the line, column, and filename", () {
Expand Down Expand Up @@ -420,7 +421,7 @@ a {
'1 │ a {b: 1 % a}\n'
' │ ^^^^^\n'
' ╵\n'
' $sassPath 1:7 root stylesheet'));
' ${prettyPath(sassPath)} 1:7 root stylesheet'));
});

test("sets the line, column, and filename", () {
Expand Down Expand Up @@ -494,7 +495,7 @@ a {
"1 │ a {b: }\n"
" │ ^\n"
" ╵\n"
" $sassPath 1:7 root stylesheet"));
" ${prettyPath(sassPath)} 1:7 root stylesheet"));
});
});
}
4 changes: 4 additions & 0 deletions test/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'dart:async';
import 'dart:convert';

import 'package:path/path.dart' as p;
import 'package:test/test.dart';

import 'package:sass/src/io.dart';
Expand All @@ -31,3 +32,6 @@ Map<String, Object> embeddedSourceMap(String css) {
expect(data.mimeType, equals("application/json"));
return jsonDecode(data.contentAsString()) as Map<String, Object>;
}

// Like `p.prettyUri()`, but for a non-URL path.
String prettyPath(String path) => p.prettyUri(p.toUri(path));
3 changes: 2 additions & 1 deletion tool/grind.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ void format() {
}

@Task('Installs dependencies from npm.')
void npmInstall() => run("npm", arguments: ["install"]);
void npmInstall() =>
run(Platform.isWindows ? "npm.cmd" : "npm", arguments: ["install"]);

@Task('Runs the tasks that are required for running tests.')
@Depends(format, synchronize, "pkg-npm-dev", npmInstall, "pkg-standalone-dev")
Expand Down