2022-12-26 00:09:26 +08:00
|
|
|
'use strict'
|
|
|
|
|
|
|
|
const path = require('node:path')
|
2023-03-30 01:49:30 +08:00
|
|
|
|
2022-12-26 00:09:26 +08:00
|
|
|
const runnerPath = path.join(__dirname, 'runner').replace(/\\/g, '/')
|
|
|
|
|
|
|
|
require.extensions['.scss'] = (module, filename) => {
|
|
|
|
const normalizedFilename = filename.replace(/\\/g, '/')
|
2022-12-25 06:29:20 +08:00
|
|
|
|
|
|
|
return module._compile(`
|
|
|
|
const runner = require('${runnerPath}')
|
2022-12-26 00:09:26 +08:00
|
|
|
runner('${normalizedFilename}', { describe, it })
|
2022-12-25 06:29:20 +08:00
|
|
|
`, filename)
|
|
|
|
}
|