-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add some tests for the pkg: import feature
- Loading branch information
Showing
20 changed files
with
62 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "pkg-import", | ||
"version": "1.0.0", | ||
"private": true, | ||
"type": "commonjs", | ||
"description": "Test using the pgk import from a module", | ||
"scripts": { | ||
"test": "node --test sass.test.js" | ||
}, | ||
"devDependencies": { | ||
"sass": "^1.71.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const assert = require("node:assert"); | ||
const { test } = require("node:test"); | ||
const sass = require("sass"); | ||
|
||
test("noscope", () => { | ||
const css = sass.compile("src/styles.scss", { | ||
importers: [new sass.NodePackageImporter()], | ||
}); | ||
assert.ok(css); | ||
assert.match(css.css, /color: green/); | ||
}); | ||
|
||
test("scope", () => { | ||
const css = sass.compile("src/scoped.scss", { | ||
importers: [new sass.NodePackageImporter()], | ||
}); | ||
assert.ok(css); | ||
assert.match(css.css, /color: green/); | ||
}); |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.