summaryrefslogtreecommitdiffstats
path: root/scss/tests/sass-true/register.js
blob: d93e414c1fa61c1a6e625ee394c2d358bf7fdb9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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)
}