Commit e2069f79 authored by Albert Salim's avatar Albert Salim

Remove dependency on jest-resolver

parent 99f98755
......@@ -100,6 +100,7 @@ overrides:
- 'scripts/**/*'
- '*.config.js'
- '*.config.*.js'
- 'jest_resolver.js'
- storybook/config/*.js
rules:
'@gitlab/require-i18n-strings': off
......
/* eslint-disable import/no-commonjs */
/* eslint-disable import/no-extraneous-dependencies */
const Resolver = require('jest-resolve');
const fs = require('fs');
// Wrap jest default resolver to detect missing frontend fixtures.
module.exports = (request, options) => {
try {
return options.defaultResolver(request, options);
} catch (e) {
if (Resolver.tryCastModuleNotFoundError(e) && request.match(/tmp\/tests\/frontend\/fixtures/)) {
/* eslint-disable no-console */
/* eslint-disable @gitlab/require-i18n-strings */
if (request.match(/tmp\/tests\/frontend\/fixtures/) && !fs.existsSync(request)) {
console.error(
'\x1b[1m\x1b[41m\x1b[30m %s \x1b[0m %s',
'!',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment