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

[Package Importer] Specs #1952

Merged
merged 65 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
ddd98e7
Stub out Package Importer tests, add changeEntryPoint to sandbox
jamesnw Oct 27, 2023
b489a76
More tests
jamesnw Oct 30, 2023
20ebaab
Parent directories
jamesnw Oct 30, 2023
51214a6
Add tests for all compilation methods
jamesnw Oct 31, 2023
db1db07
Add package export tests
jamesnw Nov 1, 2023
40f30ae
Tests for exports
jamesnw Nov 2, 2023
f4748eb
Clean up assertions
jamesnw Nov 2, 2023
68eabbb
More legacy compilation tests
jamesnw Nov 2, 2023
447ac0e
Clean up false positives, return promise from sandbox test
jamesnw Nov 3, 2023
25500cb
Promisify render tests to prevent sandbox dirs from being deleted bef…
jamesnw Nov 3, 2023
a024ff0
Nest Package Importer tests in describe
jamesnw Nov 3, 2023
fad1cc3
Wildcard tests
jamesnw Nov 7, 2023
f5e413c
Test legacy importer order
jamesnw Nov 8, 2023
1ddd748
Flesh out stubbed tests
jamesnw Nov 8, 2023
cbf39fb
Merge branch 'sass:main' into feature.package-importer
jamesnw Nov 8, 2023
c98b9ba
Merge branch 'feature.package-importer' of github.com:oddbird/sass-sp…
jamesnw Nov 8, 2023
3466dc6
Change throw expectation
jamesnw Nov 8, 2023
5e04ad9
Add browser-only test for no file system
jamesnw Nov 9, 2023
7b9743f
Run test only in browser
jamesnw Nov 9, 2023
83dc0a7
Review responses
jamesnw Nov 15, 2023
ccd2a77
Add full wildcard path test
jamesnw Nov 15, 2023
b49db2c
Move require.main.filename inside sandbox dir
jamesnw Nov 15, 2023
f96ba8d
Factor out common testPackageImporter logic
jamesnw Nov 15, 2023
88d5ae6
Fix testPackageImporter call, add scoped packages and relative import…
jamesnw Nov 15, 2023
551b5b7
Clean up paths
jamesnw Nov 16, 2023
3bbb918
Check that no match in pkg importer continues to next importer
jamesnw Nov 16, 2023
4230a0a
Fix typo
jamesnw Nov 16, 2023
137c8f9
Handle invalid URLs
jamesnw Nov 17, 2023
5a6382e
Adjust tests for Symbol and embedded host
jamesnw Nov 17, 2023
3d66845
Update fake importer test
jamesnw Nov 17, 2023
4308648
Test changes to entry point url
jamesnw Nov 22, 2023
75b02ad
Address review
jamesnw Dec 1, 2023
5b38195
Test for non-sass file result
jamesnw Dec 1, 2023
247a136
Test throw if invalid package.json
jamesnw Dec 1, 2023
0cd68eb
Add test for exports with and without .
jamesnw Dec 4, 2023
41f3416
Merge branch 'main' of https://github.com/sass/sass-spec into feature…
jamesnw Dec 11, 2023
fd4fac4
Merge branch 'main' into feature.package-importer
jgerigmeyer Dec 15, 2023
31b757a
Move to Node Package Importer Class, add test for explicit entry point
jamesnw Dec 19, 2023
70241b4
Merge branch 'feature.package-importer' of github.com:oddbird/sass-sp…
jamesnw Dec 19, 2023
1a292f5
lint
jamesnw Dec 19, 2023
a31051f
Fix importer test
jamesnw Dec 19, 2023
ad97abb
Add tests for package name errors
jamesnw Dec 20, 2023
654b451
Temporarily log full stack trace on error
jgerigmeyer Dec 20, 2023
3fdd163
add comment
jgerigmeyer Dec 20, 2023
bee93ca
Update error messages
jamesnw Jan 5, 2024
2b6a3c5
Update legacy tests for new pkgImporter syntax
jgerigmeyer Jan 5, 2024
a6cdbdf
whitespace
jgerigmeyer Jan 5, 2024
46b38be
update copyright year
jgerigmeyer Jan 5, 2024
5f76314
Update package name tests
jamesnw Jan 8, 2024
27ee25b
remove unnecessary type defs
jgerigmeyer Jan 8, 2024
7860a91
Merge branch 'main' of https://github.com/sass/sass-spec into feature…
jamesnw Jan 17, 2024
b5edacb
Merge branch 'main' of https://github.com/sass/sass-spec into feature…
jamesnw Jan 18, 2024
3f435d7
Make chdir async in sandbox
jamesnw Jan 18, 2024
a01db2a
Update expected errors
jamesnw Jan 19, 2024
d20e8b4
No error with invalid node package names
jamesnw Jan 19, 2024
b18ff2c
Address review
jgerigmeyer Jan 24, 2024
7a5e0ce
Update entry point to directory
jamesnw Feb 1, 2024
ce63d68
Make pkg:bar unique for troubleshooting
jamesnw Feb 1, 2024
029ce09
Lint
jamesnw Feb 1, 2024
628add2
Log test error
jamesnw Feb 1, 2024
c841cce
Return chdir to ensure errors don't leak, use file url toString for a…
jamesnw Feb 1, 2024
45561f4
Remove skips, relog
jamesnw Feb 1, 2024
adf2f4a
Try pathname
jamesnw Feb 1, 2024
2e5b770
Use fileURLToPath
jamesnw Feb 1, 2024
3263bc3
Pass entrypoint correctly
jamesnw Feb 1, 2024
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
9 changes: 8 additions & 1 deletion js-api-spec/importer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import {
compileStringAsync,
CanonicalizeContext,
Importer,
NodePackageImporter,
} from 'sass';

import {sassImpl, URL} from './utils';
import {sassImpl, runOnlyForImpl, URL} from './utils';

it('uses an importer to resolve an @import', () => {
const result = compileString('@import "orange";', {
Expand Down Expand Up @@ -763,6 +764,12 @@ it('throws an ArgumentError when the result sourceMapUrl is missing a scheme', (
});
});

runOnlyForImpl('browser', () => {
jamesnw marked this conversation as resolved.
Show resolved Hide resolved
it('node package loader throws error in browser', () => {
expect(() => new NodePackageImporter()).toThrow();
});
});

/**
* Returns an importer that asserts that `fromImport` is `expected`, and
* otherwise imports exclusively empty stylesheets.
Expand Down
Loading
Loading