Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command to initialize a test file #52

Closed
seaneagan opened this issue Apr 1, 2015 · 2 comments
Closed

Command to initialize a test file #52

seaneagan opened this issue Apr 1, 2015 · 2 comments
Labels
type-enhancement A request for a change that isn't a bug

Comments

@seaneagan
Copy link

Note: This could be an IDE feature, but this package will have more knowledge about how to do it, and this way it would be automatically kept up to date.

In package foo, I could run:

pub run test:init src/bar

and it would check if lib/src/bar.dart exists. If not, it will create it, something like:

library foo.src.bar;

// TODO: Library auto-generated by `pub run test:init`.

and would then create a test file for it at test/src/bar_test.dart:

library foo.test.src.bar;

import 'package:foo/src/bar.dart';
import 'package:test/test.dart';

main() {
  group('<group>', () {
    test('<test>', () {
      fail('Auto generated by `pub run test:init`.');
    }
  }
}
@zoechi
Copy link

zoechi commented Apr 1, 2015

Would be even more helpful for browser tests.

@kevmoo kevmoo added the type-enhancement A request for a change that isn't a bug label Apr 1, 2015
@nex3
Copy link
Member

nex3 commented Apr 1, 2015

I'd rather this go in a package for creating files based on templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants