BirjuVachhani / spider

A small dart library to generate Assets dart code from assets folder.
https://spider.birju.dev/
Apache License 2.0
190 stars 19 forks source link

Replace test by flutter_test #32

Closed amorenew closed 2 years ago

amorenew commented 4 years ago

When I build I got auto-generated test class with import 'package:test/test.dart'; Could you use flutter_test as it includes the required function of test library? import 'package:flutter_test/flutter_test.dart'; Thanks a lot

BirjuVachhani commented 4 years ago

@amorenew Spider is supposed to work with any dart app. That's why There's no dependency of Flutter. If I make this changes that you're requesting, it will bind tests with Flutter which I don't want.

Besides, flutter_test is built on top of test package so it is easier to add test package to your dev dependencies. And as it is a dev_dependency, it won't affect your app.

NicolasDurant commented 2 years ago

Couldn't you add an option in the spider.yaml, so it replaces the import for Flutter users to import 'package:flutter_test/flutter_test.dart'; ?

I can't add the test package to my project, because of conflicting dependencies, so I have to replace all imports every time I use spider build.

BirjuVachhani commented 2 years ago

@NicolasDurant I can probably add a configuration flag which you can enable to indicate that it should use flutter_test imports in tests.

BirjuVachhani commented 2 years ago

This has been fixed and now available in v3.1.0

There's no flag to set this. It is enabled by default and it will automatically use flutter_test if it is a flutter project.