mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-22 13:51:31 +01:00
Add timestamp to printed compile statement (#1876)
Co-authored-by: dannypernik <dannypernik@mail.com> Co-authored-by: Natalie Weizenbaum <nweiz@google.com> Co-authored-by: なつき <i@ntk.me>
This commit is contained in:
parent
13cc7d2da4
commit
c4523884bf
@ -1,5 +1,9 @@
|
||||
## 1.58.2
|
||||
|
||||
### Command Line Interface
|
||||
|
||||
* Add a timestamp to messages printed in `--watch` mode.
|
||||
|
||||
* Print better `calc()`-based suggestions for `/`-as-division expression that
|
||||
contain calculation-incompatible constructs like unary minus.
|
||||
|
||||
|
@ -127,13 +127,21 @@ Future<void> compileStylesheet(ExecutableOptions options, StylesheetGraph graph,
|
||||
|
||||
if (options.quiet || (!options.update && !options.watch)) return;
|
||||
var buffer = StringBuffer();
|
||||
if (options.color) buffer.write('\u001b[32m');
|
||||
|
||||
var sourceName = source == null ? 'stdin' : p.prettyUri(p.toUri(source));
|
||||
// `destination` is guaranteed to be non-null in update and watch mode.
|
||||
var destinationName = p.prettyUri(p.toUri(destination!));
|
||||
|
||||
var nowStr = DateTime.now().toString();
|
||||
// Remove fractional seconds from printed timestamp
|
||||
var timestamp = nowStr.substring(0, nowStr.length - 7);
|
||||
|
||||
if (options.color) buffer.write('\u001b[90m');
|
||||
buffer.write('[$timestamp] ');
|
||||
if (options.color) buffer.write('\u001b[32m');
|
||||
buffer.write('Compiled $sourceName to $destinationName.');
|
||||
if (options.color) buffer.write('\u001b[0m');
|
||||
|
||||
print(buffer);
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: sass
|
||||
version: 1.58.2-dev
|
||||
version: 1.58.2
|
||||
description: A Sass implementation in Dart.
|
||||
homepage: https://github.com/sass/dart-sass
|
||||
|
||||
|
@ -18,7 +18,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await d.file("test.scss", "a {b: c}").create();
|
||||
|
||||
var sass = await update(["test.scss:out.css"]);
|
||||
expect(sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
expect(sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.shouldExit(0);
|
||||
|
||||
await d
|
||||
@ -32,7 +32,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await d.file("test.scss", "a {b: c}").create();
|
||||
|
||||
var sass = await update(["test.scss:out.css"]);
|
||||
expect(sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
expect(sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.shouldExit(0);
|
||||
|
||||
await d
|
||||
@ -45,14 +45,14 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await d.file("test.scss", "@import 'other'").create();
|
||||
|
||||
var sass = await update(["test.scss:out.css"]);
|
||||
expect(sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
expect(sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.shouldExit(0);
|
||||
|
||||
await tick;
|
||||
await d.file("other.scss", "x {y: z}").create();
|
||||
|
||||
sass = await update(["test.scss:out.css"]);
|
||||
expect(sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
expect(sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.shouldExit(0);
|
||||
|
||||
await d
|
||||
@ -66,16 +66,16 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await d.file("test2.scss", r"$var: 2; @import 'other'").create();
|
||||
|
||||
var sass = await update(["test1.scss:out1.css", "test2.scss:out2.css"]);
|
||||
expect(sass.stdout, emits('Compiled test1.scss to out1.css.'));
|
||||
expect(sass.stdout, emits('Compiled test2.scss to out2.css.'));
|
||||
expect(sass.stdout, emits(endsWith('Compiled test1.scss to out1.css.')));
|
||||
expect(sass.stdout, emits(endsWith('Compiled test2.scss to out2.css.')));
|
||||
await sass.shouldExit(0);
|
||||
|
||||
await tick;
|
||||
await d.file("other.scss", r"x {y: $var}").create();
|
||||
|
||||
sass = await update(["test1.scss:out1.css", "test2.scss:out2.css"]);
|
||||
expect(sass.stdout, emits('Compiled test1.scss to out1.css.'));
|
||||
expect(sass.stdout, emits('Compiled test2.scss to out2.css.'));
|
||||
expect(sass.stdout, emits(endsWith('Compiled test1.scss to out1.css.')));
|
||||
expect(sass.stdout, emits(endsWith('Compiled test2.scss to out2.css.')));
|
||||
await sass.shouldExit(0);
|
||||
|
||||
await d
|
||||
@ -90,7 +90,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
var sass = await update(["-:out.css"]);
|
||||
sass.stdin.writeln("a {b: c}");
|
||||
sass.stdin.close();
|
||||
expect(sass.stdout, emits('Compiled stdin to out.css.'));
|
||||
expect(sass.stdout, emits(endsWith('Compiled stdin to out.css.')));
|
||||
await sass.shouldExit(0);
|
||||
|
||||
await d
|
||||
@ -100,7 +100,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
sass = await update(["-:out.css"]);
|
||||
sass.stdin.writeln("x {y: z}");
|
||||
sass.stdin.close();
|
||||
expect(sass.stdout, emits('Compiled stdin to out.css.'));
|
||||
expect(sass.stdout, emits(endsWith('Compiled stdin to out.css.')));
|
||||
await sass.shouldExit(0);
|
||||
|
||||
await d
|
||||
@ -142,7 +142,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await d.file("test2.scss", "d {e: f}").create();
|
||||
|
||||
var sass = await update(["test1.scss:out1.css", "test2.scss:out2.css"]);
|
||||
expect(sass.stdout, emits('Compiled test2.scss to out2.css.'));
|
||||
expect(sass.stdout, emits(endsWith('Compiled test2.scss to out2.css.')));
|
||||
await sass.shouldExit(0);
|
||||
|
||||
await d.file("out1.css", "x {y: z}").validate();
|
||||
|
@ -40,7 +40,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await sass.kill();
|
||||
|
||||
@ -71,8 +71,8 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await expectLater(sass.stderr, emits(message));
|
||||
await expectLater(
|
||||
sass.stderr, emitsThrough(contains('test1.scss 1:7')));
|
||||
await expectLater(
|
||||
sass.stdout, emitsThrough('Compiled test2.scss to out2.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emitsThrough(endsWith('Compiled test2.scss to out2.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await sass.kill();
|
||||
|
||||
@ -95,8 +95,8 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
sass.stderr, emits('Error: Expected expression.'));
|
||||
await expectLater(
|
||||
sass.stderr, emitsThrough(contains('test1.scss 1:7')));
|
||||
await expectLater(
|
||||
sass.stdout, emitsThrough('Compiled test2.scss to out2.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emitsThrough(endsWith('Compiled test2.scss to out2.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await sass.kill();
|
||||
|
||||
@ -138,13 +138,13 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("test.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -156,14 +156,14 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await d.dir("dir", [d.file("test.scss", "a {b: c}")]).create();
|
||||
|
||||
var sass = await watch(["dir:out"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits(_compiled('dir/test.scss', 'out/test.css')));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith(_compiled('dir/test.scss', 'out/test.css'))));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.dir("dir", [d.file("test.scss", "x {y: z}")]).create();
|
||||
await expectLater(
|
||||
sass.stdout, emits(_compiled('dir/test.scss', 'out/test.css')));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith(_compiled('dir/test.scss', 'out/test.css'))));
|
||||
await sass.kill();
|
||||
|
||||
await d.dir("out", [
|
||||
@ -178,13 +178,13 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["."]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to test.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to test.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("test.scss", "r {o: g}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to test.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to test.css.')));
|
||||
|
||||
// When using the native Node.js watcher on Linux, the "modify" event
|
||||
// from writing test.css can interfere with the "modify" event from
|
||||
@ -194,7 +194,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
await d.file("test.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to test.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to test.css.')));
|
||||
|
||||
await sass.kill();
|
||||
|
||||
@ -210,13 +210,13 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("_other.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -230,13 +230,13 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("_other.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -250,13 +250,13 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("_other.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -273,14 +273,14 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
""").create();
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("_other.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -296,14 +296,14 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
""").create();
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("_other.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -319,14 +319,14 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
""").create();
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("_other.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -342,14 +342,14 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
""").create();
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("_other.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -365,7 +365,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
@ -378,7 +378,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
await d.file("_other.scss", "q {r: s}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await tick;
|
||||
await d
|
||||
.file("out.css", equalsIgnoringWhitespace("q { r: s; }"))
|
||||
@ -386,7 +386,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
await d.file("_other.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await tick;
|
||||
await d
|
||||
.file("out.css", equalsIgnoringWhitespace("x { y: z; }"))
|
||||
@ -401,7 +401,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
@ -413,7 +413,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
await d.file("test.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -426,7 +426,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
@ -445,7 +445,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["--stop-on-error", "test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
@ -470,7 +470,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
@ -491,13 +491,13 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["-I", "dir", "test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
d.file("_other.scss").io.deleteSync();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -518,7 +518,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
d.file("_other.sass").io.deleteSync();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -541,8 +541,8 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("_other.scss", "a {b: c}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -563,8 +563,8 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await tickIfPoll();
|
||||
|
||||
await d.dir("dir", [d.file("_other.scss", "a {b: c}")]).create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -586,7 +586,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
await d.dir("dir2", [d.file("_other.scss", "a {b: c}")]).create();
|
||||
await expectLater(sass.stdout,
|
||||
emits(_compiled('dir1/test.scss', 'out/test.css')));
|
||||
emits(endsWith(_compiled('dir1/test.scss', 'out/test.css'))));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -601,7 +601,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
@ -621,14 +621,14 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(
|
||||
["-I", "dir1", "-I", "dir2", "test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.dir("dir1", [d.file("_other.scss", "x {y: z}")]).create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -641,14 +641,14 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await d.dir("dir", [d.file("_other.scss", "a {b: c}")]).create();
|
||||
|
||||
var sass = await watch(["-I", "dir", "test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("_other.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -662,14 +662,14 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
.dir("other", [d.file("_index.scss", "a {b: c}")]).create();
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("_other.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -693,8 +693,8 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await d.dir("dir", [d.file("test.scss", "a {b: c}")]).create();
|
||||
await expectLater(
|
||||
sass.stdout,
|
||||
emits('Compiled ${p.join('dir', 'test.scss')} to '
|
||||
'${p.join('out', 'test.css')}.'));
|
||||
emits(endsWith('Compiled ${p.join('dir', 'test.scss')} to '
|
||||
'${p.join('out', 'test.css')}.')));
|
||||
await sass.kill();
|
||||
|
||||
await d.dir("out", [
|
||||
@ -709,13 +709,13 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.css:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.css to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.css to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.file("test.css", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.css to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.css to out.css.')));
|
||||
await sass.kill();
|
||||
|
||||
await d
|
||||
@ -735,17 +735,19 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await expectLater(
|
||||
sass.stdout,
|
||||
emitsInAnyOrder([
|
||||
_compiled('dir/test1.scss', 'out/test1.css'),
|
||||
_compiled('dir/test2.scss', 'out/test2.css')
|
||||
endsWith(_compiled('dir/test1.scss', 'out/test1.css')),
|
||||
endsWith(_compiled('dir/test2.scss', 'out/test2.css'))
|
||||
]));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.dir("dir", [d.file("test2.scss", "x {y: z}")]).create();
|
||||
await expectLater(
|
||||
sass.stdout, emits(_compiled('dir/test2.scss', 'out/test2.css')));
|
||||
expect(sass.stdout,
|
||||
neverEmits(_compiled('dir/test1.scss', 'out/test1.css')));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith(_compiled('dir/test2.scss', 'out/test2.css'))));
|
||||
expect(
|
||||
sass.stdout,
|
||||
neverEmits(
|
||||
endsWith(_compiled('dir/test1.scss', 'out/test1.css'))));
|
||||
await tick;
|
||||
await sass.kill();
|
||||
});
|
||||
@ -759,12 +761,13 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["-I", "dir", "test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
await d.dir("dir", [d.file("_other.scss", "a {b: c}")]).create();
|
||||
expect(sass.stdout, neverEmits('Compiled test.scss to out.css.'));
|
||||
expect(sass.stdout,
|
||||
neverEmits(endsWith('Compiled test.scss to out.css.')));
|
||||
await tick;
|
||||
await sass.kill();
|
||||
|
||||
@ -780,7 +783,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
var sass = await watch(["test.scss:out.css"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits('Compiled test.scss to out.css.'));
|
||||
sass.stdout, emits(endsWith('Compiled test.scss to out.css.')));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
@ -795,8 +798,8 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await d.dir("dir", [d.file("test.scss", "a {b: c}")]).create();
|
||||
|
||||
var sass = await watch(["dir:out"]);
|
||||
await expectLater(
|
||||
sass.stdout, emits(_compiled('dir/test.scss', 'out/test.css')));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith(_compiled('dir/test.scss', 'out/test.css'))));
|
||||
await expectLater(sass.stdout, _watchingForChanges);
|
||||
await tickIfPoll();
|
||||
|
||||
@ -817,8 +820,8 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
await tickIfPoll();
|
||||
|
||||
await d.dir("dir", [d.file("test.scss", "a {b: c}")]).create();
|
||||
await expectLater(
|
||||
sass.stdout, emits(_compiled('dir/test.scss', 'out/test.css')));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith(_compiled('dir/test.scss', 'out/test.css'))));
|
||||
await sass.kill();
|
||||
|
||||
await d.dir("out", [
|
||||
@ -835,7 +838,7 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
|
||||
await d.dir("dir", [d.file("_test.scss", "a {b: c}")]).create();
|
||||
expect(sass.stdout,
|
||||
neverEmits(_compiled('dir/test.scss', 'out/test.css')));
|
||||
neverEmits(endsWith(_compiled('dir/test.scss', 'out/test.css'))));
|
||||
await tick;
|
||||
await sass.kill();
|
||||
|
||||
@ -857,8 +860,8 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
||||
// did incorrectly trigger a compilation, it would emit a message
|
||||
// before the message for this change.
|
||||
await d.file("dir/test2.scss", "x {y: z}").create();
|
||||
await expectLater(
|
||||
sass.stdout, emits(_compiled('dir/test2.scss', 'dir/test2.css')));
|
||||
await expectLater(sass.stdout,
|
||||
emits(endsWith(_compiled('dir/test2.scss', 'dir/test2.css'))));
|
||||
|
||||
await sass.kill();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user