Skip to content

Commit 73266db

Browse files
committed
simplify test
1 parent 30962e7 commit 73266db

File tree

2 files changed

+6
-29
lines changed

2 files changed

+6
-29
lines changed

test/screenshot_test.dart

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -121,36 +121,13 @@ void main() {
121121
});
122122

123123
test('same name screenshots are not overridden', () async {
124-
final descriptor = package(
125-
'my_package',
126-
pubspecExtras: {
127-
'screenshots': [
128-
{'description': 'description', 'path': 's1/static.webp'},
129-
{'description': 'description', 'path': 's2/static.webp'},
130-
],
131-
},
132-
extraFiles: [
133-
d.dir('s1', [
134-
d.file(
135-
'static.webp',
136-
File(p.join(_testImagesDir, 'static.webp')).readAsBytesSync(),
137-
),
138-
]),
139-
d.dir('s2', [
140-
d.file(
141-
'static.webp',
142-
File(p.join(_testImagesDir, 'static.webp')).readAsBytesSync(),
143-
),
144-
]),
145-
],
146-
);
124+
if (!hasWebpTools) return;
147125

148-
await descriptor.create();
149-
final screenshots = [
150-
Screenshot('description', 's1/static.webp'),
151-
Screenshot('description', 's2/static.webp'),
152-
];
153-
final result = await processAllScreenshots(screenshots, descriptor.io.path);
126+
final pkgDir = _testImagesDir;
127+
final s = Screenshot('description', 'static.webp');
128+
final s2 = Screenshot('description', 's2/static.webp');
129+
130+
final result = await processAllScreenshots([s, s2], pkgDir);
154131

155132
expect(result.length, 2);
156133
expect(result[0].problems, isEmpty);

test/testImages/s2/static.webp

3.27 KB
Loading

0 commit comments

Comments
 (0)