mirror of
https://github.com/flutter/samples.git
synced 2026-03-25 13:51:35 +00:00
Fix sample index deployment action (#862)
* Update sample index dependencies * Update to tuneup 0.3.8, update dependencies * Upgrade to null safety, lock sass version * fix analyzer warnings * Fix unit tests * Fix issues from upgrading to null safety
This commit is contained in:
@@ -16,15 +16,18 @@ void main() {
|
||||
var contents = await file.readAsString();
|
||||
expect(contents, isNotEmpty);
|
||||
|
||||
var index = checkedYamlDecode(contents, (m) => Index.fromJson(m),
|
||||
var index = checkedYamlDecode(contents, (m) => m != null ? Index.fromJson(m) : null,
|
||||
sourceUrl: file.uri);
|
||||
if (index == null) {
|
||||
throw('unable to load YAML from $file');
|
||||
}
|
||||
expect(index.samples, isNotEmpty);
|
||||
|
||||
var sample = index.samples.first;
|
||||
expect(sample, isNotNull);
|
||||
expect(sample.name, 'Kittens');
|
||||
expect(sample.screenshots, hasLength(2));
|
||||
expect(sample.source, 'http://github.com/johnpryan/kittens');
|
||||
expect(sample.source, 'https://github.com/johnpryan/kittens');
|
||||
expect(sample.description, 'A sample kitten app');
|
||||
expect(sample.difficulty, 'beginner');
|
||||
expect(sample.widgets, hasLength(2));
|
||||
@@ -36,7 +39,7 @@ void main() {
|
||||
expect(sample.platforms, hasLength(3));
|
||||
expect(sample.links, hasLength(2));
|
||||
expect(sample.links[1].text, 'author');
|
||||
expect(sample.links[1].href, 'http://jpryan.me');
|
||||
expect(sample.links[1].href, 'https://jpryan.me');
|
||||
expect(sample.type, 'sample');
|
||||
expect(sample.date, DateTime.parse('2019-12-15T02:59:43.1Z'));
|
||||
expect(sample.channel, 'stable');
|
||||
@@ -49,8 +52,11 @@ void main() {
|
||||
var contents = await file.readAsString();
|
||||
expect(contents, isNotEmpty);
|
||||
|
||||
var index = checkedYamlDecode(contents, (m) => Index.fromJson(m),
|
||||
var index = checkedYamlDecode(contents, (m) => m != null ? Index.fromJson(m) : null,
|
||||
sourceUrl: file.uri);
|
||||
if (index == null) {
|
||||
throw('unable to load YAML from $file');
|
||||
}
|
||||
var sample = index.samples.first;
|
||||
expect(
|
||||
sample.searchAttributes.split(' '),
|
||||
|
||||
@@ -5,7 +5,7 @@ samples:
|
||||
alt: a kitten
|
||||
- url: https://placekitten.com/400/400
|
||||
alt: another kitten
|
||||
source: http://github.com/johnpryan/kittens
|
||||
source: https://github.com/johnpryan/kittens
|
||||
description: A sample kitten app
|
||||
difficulty: beginner
|
||||
widgets:
|
||||
@@ -20,7 +20,7 @@ samples:
|
||||
- text: inspiration
|
||||
href: https://apps.apple.com/us/app/neko-atsume-kitty-collector/id923917775
|
||||
- text: author
|
||||
href: http://jpryan.me
|
||||
href: https://jpryan.me
|
||||
type: sample # sample, app, or cookbook
|
||||
date: 2019-12-15T02:59:43.1Z
|
||||
channel: stable
|
||||
|
||||
Reference in New Issue
Block a user