diff --git a/snapcraft/tests/test_plugin_nodejs.py b/snapcraft/tests/test_plugin_nodejs.py
index 912cb78..7775fc2 100644
--- a/snapcraft/tests/test_plugin_nodejs.py
+++ b/snapcraft/tests/test_plugin_nodejs.py
@@ -58,6 +58,28 @@ class NodePluginTestCase(tests.TestCase):
path.join(os.path.abspath('.'), 'parts', 'test-part', 'npm')),
mock.call().pull()])
+ def test_build_local_sources_and_node_folder(self):
+ class Options:
+ source = '.'
+ node_packages = []
+ node_folder = [ 'subdir' ]
+
+ plugin = nodejs.NodePlugin('test-part', Options())
+
+ os.makedirs(plugin.sourcedir)
+ os.makedirs(os.path.join(plugin.sourcedir, node_folder))
+ open(os.path.join(plugin.sourcedir, node_folder, 'package.json'), 'w').close()
+
+ plugin.build()
+
+ self.run_mock.assert_has_calls([
+ mock.call(['npm', 'install', '-g'], cwd=plugin.builddir)])
+ self.tar_mock.assert_has_calls([
+ mock.call(
+ nodejs._get_nodejs_release(),
+ path.join(os.path.abspath('.'), 'parts', 'test-part', 'npm')),
+ mock.call().provision(plugin.installdir)])
+
def test_build_local_sources(self):
class Options:
source = '.'