Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dwds/test/dart_uri_file_uri_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ final context = TestContext(
final dwdsDir = Directory.current.absolute.path;

/// The directory for the general _test package.
final testDir = p.join(p.dirname(dwdsDir), 'fixtures', '_test');
final testDir = p.normalize(p.absolute(p.relative(
p.join('..', 'fixtures', '_test'),
from: p.current,
)));

/// The directory for the _testPackage package (contained within dwds), which
/// imports _test.
Expand Down
16 changes: 8 additions & 8 deletions dwds/test/fixtures/context.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ class TestContext {
this.path = 'hello_world/index.html',
this.pathToServe = 'example',
}) {
final packageName = nullSafety == NullSafety.sound ? '_testSound' : '_test';
final relativeDirectory = p.join('..', 'fixtures', packageName);
final defaultPackage =
nullSafety == NullSafety.sound ? '_testSound' : '_test';
final defaultDirectory = p.join('..', 'fixtures', defaultPackage);
final defaultEntry = p.join('..', 'fixtures', defaultPackage, 'example',
'append_body', 'main.dart');

final relativeEntry = p.join(
'..', 'fixtures', packageName, 'example', 'append_body', 'main.dart');

workingDirectory = p.normalize(p
.absolute(directory ?? p.relative(relativeDirectory, from: p.current)));
workingDirectory = p.normalize(
p.absolute(p.relative(directory ?? defaultDirectory, from: p.current)));

DartUri.currentDirectory = workingDirectory;

Expand All @@ -138,7 +138,7 @@ class TestContext {
p.toUri(p.join(workingDirectory, '.dart_tool/package_config.json'));

final entryFilePath = p.normalize(
p.absolute(entry ?? p.relative(relativeEntry, from: p.current)));
p.absolute(p.relative(entry ?? defaultEntry, from: p.current)));

_logger.info('Serving: $pathToServe/$path');
_logger.info('Project: $_projectDirectory');
Expand Down