Skip to content

Commit

Permalink
Add a regression test for a meta.load-css bug in Dart Sass (#1793)
Browse files Browse the repository at this point in the history
See #1627
  • Loading branch information
nex3 committed Jun 17, 2022
1 parent 7e47b81 commit 144ec9a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions js-api-spec/legacy/render.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,29 @@ describe('renderSync()', () => {
).toEqualIgnoringWhitespace('a { b: c; }');
}));
});

// Regression test for sass/dart-sass#1672
it('resolves meta.load-css() relative to the containing file', () =>
sandbox(dir => {
dir.write({
'sub/_upstream.scss': 'a {b: c}',
'sub/_midstream.scss': `
@use 'sass:meta';
@mixin mixin {
@include meta.load-css('upstream');
}
`,
'downstream.scss': `
@use 'sub/midstream';
@include midstream.mixin;
`,
});
expect(
sass.renderSync({file: dir('downstream.scss')}).css.toString()
).toEqualIgnoringWhitespace('a { b: c; }');
}));
});

describe('render()', () => {
Expand Down

0 comments on commit 144ec9a

Please sign in to comment.