mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 01:38:07 +08:00
We already had PostCSS as an implicit dep because stylelint depends on it. I need to use its API to parse CSS for some of the dark mode migration, so I'm moving postcss to be a top level dep. DISABLE_THIRD_PARTY_CHECK=updating node modules Bug: chromium:1152736 Change-Id: I93919fb2d676337604209cf6bf9c8570f98bd5e0 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2780799 Commit-Queue: Jack Franklin <jacktfranklin@chromium.org> Auto-Submit: Jack Franklin <jacktfranklin@chromium.org> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
55 lines
1.8 KiB
JavaScript
55 lines
1.8 KiB
JavaScript
var test = require('tape');
|
|
var resolve = require('../');
|
|
var path = require('path');
|
|
|
|
test('shadowed core modules still return core module', function (t) {
|
|
t.plan(2);
|
|
|
|
resolve('util', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) {
|
|
t.ifError(err);
|
|
t.equal(res, 'util');
|
|
});
|
|
});
|
|
|
|
test('shadowed core modules still return core module [sync]', function (t) {
|
|
t.plan(1);
|
|
|
|
var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core') });
|
|
|
|
t.equal(res, 'util');
|
|
});
|
|
|
|
test('shadowed core modules return shadow when appending `/`', function (t) {
|
|
t.plan(2);
|
|
|
|
resolve('util/', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) {
|
|
t.ifError(err);
|
|
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
|
|
});
|
|
});
|
|
|
|
test('shadowed core modules return shadow when appending `/` [sync]', function (t) {
|
|
t.plan(1);
|
|
|
|
var res = resolve.sync('util/', { basedir: path.join(__dirname, 'shadowed_core') });
|
|
|
|
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
|
|
});
|
|
|
|
test('shadowed core modules return shadow with `includeCoreModules: false`', function (t) {
|
|
t.plan(2);
|
|
|
|
resolve('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false }, function (err, res) {
|
|
t.ifError(err);
|
|
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
|
|
});
|
|
});
|
|
|
|
test('shadowed core modules return shadow with `includeCoreModules: false` [sync]', function (t) {
|
|
t.plan(1);
|
|
|
|
var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false });
|
|
|
|
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
|
|
});
|