diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-24 12:44:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-24 12:44:49 +0000 |
commit | db46bfc03f3a22752ef6bd91ae577d893872a216 (patch) | |
tree | 89d924513bc95e6bac4dc8e26f0da84caa477b7b /scss/tests/sass-true | |
parent | Releasing debian version 5.2.3+dfsg-8. (diff) | |
download | bootstrap-html-db46bfc03f3a22752ef6bd91ae577d893872a216.tar.xz bootstrap-html-db46bfc03f3a22752ef6bd91ae577d893872a216.zip |
Merging upstream version 5.3.0+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scss/tests/sass-true')
-rw-r--r-- | scss/tests/sass-true/register.js | 14 | ||||
-rw-r--r-- | scss/tests/sass-true/runner.js | 17 |
2 files changed, 31 insertions, 0 deletions
diff --git a/scss/tests/sass-true/register.js b/scss/tests/sass-true/register.js new file mode 100644 index 0000000..d93e414 --- /dev/null +++ b/scss/tests/sass-true/register.js @@ -0,0 +1,14 @@ +'use strict' + +const path = require('node:path') + +const runnerPath = path.join(__dirname, 'runner').replace(/\\/g, '/') + +require.extensions['.scss'] = (module, filename) => { + const normalizedFilename = filename.replace(/\\/g, '/') + + return module._compile(` + const runner = require('${runnerPath}') + runner('${normalizedFilename}', { describe, it }) + `, filename) +} diff --git a/scss/tests/sass-true/runner.js b/scss/tests/sass-true/runner.js new file mode 100644 index 0000000..bef870a --- /dev/null +++ b/scss/tests/sass-true/runner.js @@ -0,0 +1,17 @@ +'use strict' + +const fs = require('node:fs') +const path = require('node:path') +const { runSass } = require('sass-true') + +module.exports = (filename, { describe, it }) => { + const data = fs.readFileSync(filename, 'utf8') + const TRUE_SETUP = '$true-terminal-output: false; @import "true";' + const sassString = TRUE_SETUP + data + + runSass( + { describe, it, sourceType: 'string' }, + sassString, + { loadPaths: [path.dirname(filename)] } + ) +} |