From 4faa4ea298edfd68a9c326dee7c2110755970224 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 25 Sep 2015 16:25:59 -0400 Subject: [PATCH] test for module importing itself --- test/function/cannot-import-self/_config.js | 8 ++++++++ test/function/cannot-import-self/main.js | 1 + 2 files changed, 9 insertions(+) create mode 100644 test/function/cannot-import-self/_config.js create mode 100644 test/function/cannot-import-self/main.js diff --git a/test/function/cannot-import-self/_config.js b/test/function/cannot-import-self/_config.js new file mode 100644 index 0000000..2413d03 --- /dev/null +++ b/test/function/cannot-import-self/_config.js @@ -0,0 +1,8 @@ +var assert = require( 'assert' ); + +module.exports = { + description: 'prevents a module importing itself', + error: function ( err ) { + assert.ok( /A module cannot import itself/.test( err.message ) ); + } +}; diff --git a/test/function/cannot-import-self/main.js b/test/function/cannot-import-self/main.js new file mode 100644 index 0000000..48e08e6 --- /dev/null +++ b/test/function/cannot-import-self/main.js @@ -0,0 +1 @@ +import me from './main';