rehlma / flutter-test-real-productionr1
Test the real production implementation
PublicTests must exercise code from lib; never reproduce the implementation or mock the production class under test.
tests, run by the registry2 passed · slowest 2.1 ms
✓fires2.1 ms
reminds when writing a behavioral test
write test/unit/store_test.dart · in fixtures/flutterfired: line 1
test('loads the store', () {});✓quiet2.0 ms
is quiet for helper edits, reads and non-Flutter packages
write test/unit/store_test.dart · in fixtures/flutterstayed quiet
final fixture = Store();read test/unit/store_test.dart · in fixtures/flutterno handler of the detector wants this event
test('loads', () {});write test/unit/store_test.dart · in fixtures/dartstayed quiet
test('loads', () {});detector.test.tseach detect() call runs the real detector
import { expect, test } from 'vitest';
import { detect, write, edit, read, command, output, prompt } from '@wellactually/sdk/v3/test';
const flutter = { project: 'fixtures/flutter' };
const dart = { project: 'fixtures/dart' };
test('reminds when writing a behavioral test', () => {
expect(detect(write('test/unit/store_test.dart', "test('loads the store', () {});"), flutter)).toEqual([{ line: 1, depth: 'pointer' }]);
});
test('is quiet for helper edits, reads and non-Flutter packages', () => {
expect(detect(write('test/unit/store_test.dart', 'final fixture = Store();'), flutter)).toEqual([]);
expect(detect(read('test/unit/store_test.dart', "test('loads', () {});"), flutter)).toEqual([]);
expect(detect(write('test/unit/store_test.dart', "test('loads', () {});"), dart)).toEqual([]);
});