File: main.js

package info (click to toggle)
node-rollup-plugin-inject 4.0.2%2B~3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,552 kB
  • sloc: javascript: 10,197; makefile: 5
file content (16 lines) | stat: -rwxr-xr-x 296 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* eslint-disable import/no-dynamic-require, global-require */

let message;

function takeModule(withName) {
  return require(`./${withName}`);
}

try {
  const submodule = takeModule('submodule');
  message = submodule();
} catch (err) {
  ({ message } = err);
}

t.is(message, 'Hello there');