Skip to content

Commit 21487ce

Browse files
authored
Move test skips before the test body (#3656)
Style improves in many cases when the block structured argument is last. The skip also is likely to get lost visually when it follows a long test body, it is metadata that makes sense to put early in the test definition.
1 parent 0d0de89 commit 21487ce

File tree

9 files changed

+23
-14
lines changed

9 files changed

+23
-14
lines changed

_test/test/hello_world_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void main() {
2323
expect(document.body!.text, contains(message));
2424
});
2525

26-
test('failing test', () {
26+
test('failing test', skip: 'Expected failure', () {
2727
expect(true, isFalse);
28-
}, skip: 'Expected failure');
28+
});
2929
}

_test/test/serve_integration_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,11 @@ void main() {
4949
isNot(contains('Hello World!')));
5050
});
5151

52-
test('Can run passing tests with --pub-serve', () async {
52+
test('Can run passing tests with --pub-serve',
53+
skip: 'TODO: Get non-custom html tests passing with pub serve',
54+
() async {
5355
await expectTestsPass(usePrecompiled: false);
54-
}, skip: 'TODO: Get non-custom html tests passing with pub serve');
56+
});
5557

5658
test('Serves a directory list when it fails to fallback on index.html',
5759
() async {

build_resolvers/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 2.4.3-wip
2+
13
## 2.4.2
24

35
- Add a builder to clean up transitive digest files from the build output.

build_resolvers/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_resolvers
2-
version: 2.4.2
2+
version: 2.4.3-wip
33
description: Resolve Dart code in a Builder
44
repository: https://github.com/dart-lang/build/tree/master/build_resolvers
55

build_resolvers/test/resolver_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void main() {
182182
});
183183

184184
test('allows a version of analyzer compatibile with the current sdk',
185-
() async {
185+
skip: _skipOnPreRelease, () async {
186186
var originalLevel = Logger.root.level;
187187
Logger.root.level = Level.WARNING;
188188
var listener = Logger.root.onRecord.listen((record) {
@@ -197,7 +197,7 @@ void main() {
197197
}, (resolver) async {
198198
await resolver.libraryFor(entryPoint);
199199
}, resolvers: AnalyzerResolvers());
200-
}, skip: _skipOnPreRelease);
200+
});
201201
});
202202

203203
group('assets that aren\'t a transitive import of input', () {
@@ -491,7 +491,7 @@ void main() {
491491
}, resolvers: AnalyzerResolvers());
492492
});
493493

494-
test('Respects withEnabledExperiments', () async {
494+
test('Respects withEnabledExperiments', skip: _skipOnPreRelease, () async {
495495
Logger.root.level = Level.ALL;
496496
Logger.root.onRecord.listen(print);
497497
await withEnabledExperiments(
@@ -511,7 +511,7 @@ int? get x => 1;
511511
expect(errors.errors, isEmpty);
512512
}, resolvers: AnalyzerResolvers()),
513513
['non-nullable']);
514-
}, skip: _skipOnPreRelease);
514+
});
515515

516516
test('can get a new analysis session after resolving additional assets',
517517
() async {

build_runner/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 2.4.9-wip
2+
13
## 2.4.8
24

35
- Update README.md to point to the FAQ and other docs.

build_runner/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_runner
2-
version: 2.4.8
2+
version: 2.4.9-wip
33
description: A build system for Dart code generation and modular compilation.
44
repository: https://github.com/dart-lang/build/tree/master/build_runner
55

build_runner/test/daemon/daemon_test.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ main() {
139139
await startDaemon();
140140
});
141141

142-
test('shuts down on build script change', () async {
142+
test('shuts down on build script change',
143+
skip: 'https://github.com/dart-lang/build/issues/3438', () async {
143144
await startDaemon();
144145
var client = await startClient()
145146
..registerBuildTarget(webTarget)
@@ -154,7 +155,7 @@ main() {
154155
])
155156
])
156157
]).create();
157-
}, skip: 'https://github.com/dart-lang/build/issues/3438');
158+
});
158159

159160
test('supports --enable-experiment option', () async {
160161
// TODO: Check for specific message about a bad experiment

build_runner/test/integration_tests/symlinks_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,16 @@ void main() {
7272
});
7373

7474
group('serve', () {
75-
test('watches a linked file', () async {
75+
test('watches a linked file',
76+
skip: 'Watcher package does not support watching symlink targets',
77+
() async {
7678
var server = await buildTool.serve();
7779
await server.nextSuccessfulBuild;
7880
await expectGeneratedContent('linked');
7981

8082
await updateLinkContent('new content');
8183
await server.nextSuccessfulBuild;
8284
await expectGeneratedContent('new content');
83-
}, skip: 'Watcher package does not support watching symlink targets');
85+
});
8486
});
8587
}

0 commit comments

Comments
 (0)