Skip to content

Commit

Permalink
Add a regression test for #550
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Feb 25, 2020
1 parent 01ed720 commit f8c74d1
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/cli/shared/watch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,43 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
.file("out.css", equalsIgnoringWhitespace("x { y: z; }"))
.validate();
});

// Regression test for #550
test("with an error that's later fixed", () async {
await d.file("_other.scss", "a {b: c}").create();
await d.file("test.scss", "@import 'other'").create();

var sass = await watch(["test.scss:out.css"]);
await expectLater(
sass.stdout, emits('Compiled test.scss to out.css.'));
await expectLater(sass.stdout, _watchingForChanges);
await tickIfPoll();

await d.file("_other.scss", "a {b: }").create();
await expectLater(
sass.stderr, emits('Error: Expected expression.'));
await expectLater(
sass.stderr, emitsThrough(contains('test.scss 1:9')));
await tickIfPoll();

await d.file("_other.scss", "q {r: s}").create();
await expectLater(
sass.stdout, emits('Compiled test.scss to out.css.'));
await tick;
await d
.file("out.css", equalsIgnoringWhitespace("q { r: s; }"))
.validate();

await d.file("_other.scss", "x {y: z}").create();
await expectLater(
sass.stdout, emits('Compiled test.scss to out.css.'));
await tick;
await d
.file("out.css", equalsIgnoringWhitespace("x { y: z; }"))
.validate();

await sass.kill();
});
});

test("when it's deleted and re-added", () async {
Expand Down

0 comments on commit f8c74d1

Please sign in to comment.