mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-01 01:21:49 +02:00
Make scss tests work on Windows too. (#37713)
Also, add missing `'use strict'` statements; these aren't real modules.
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
/* eslint-env node */
|
||||
|
||||
const runnerPath = require('node:path').join(__dirname, 'runner')
|
||||
'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, '/')
|
||||
|
||||
require.extensions['.scss'] = function (module, filename) {
|
||||
return module._compile(`
|
||||
const runner = require('${runnerPath}')
|
||||
runner('${filename}',{describe, it})
|
||||
runner('${normalizedFilename}', { describe, it })
|
||||
`, filename)
|
||||
}
|
||||
|
@@ -1,12 +1,14 @@
|
||||
/* eslint-env node */
|
||||
|
||||
'use strict'
|
||||
|
||||
const { runSass } = require('sass-true')
|
||||
const fs = require('node:fs')
|
||||
const path = require('node:path')
|
||||
|
||||
module.exports = function (filename, { describe, it }) {
|
||||
const data = fs.readFileSync(filename, { encoding: 'utf8' })
|
||||
const TRUE_SETUP = '$true-terminal-output: false; @import \'true\';'
|
||||
module.exports = (filename, { describe, it }) => {
|
||||
const data = fs.readFileSync(filename, 'utf8')
|
||||
const TRUE_SETUP = '$true-terminal-output: false; @import "true";'
|
||||
|
||||
runSass({
|
||||
data: TRUE_SETUP + data,
|
||||
|
Reference in New Issue
Block a user