We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e743965 commit 807542aCopy full SHA for 807542a
lib/commands/test-init.ts
@@ -37,6 +37,18 @@ class TestInitCommand implements ICommand {
37
'save-dev': true,
38
optional: false,
39
});
40
+
41
+ let modulePath = path.join(projectDir, "node_modules", mod);
42
+ let modulePackageJsonPath = path.join(modulePath, "package.json");
43
+ let modulePackageJsonContent = this.$fs.readJson(modulePackageJsonPath);
44
+ let modulePeerDependencies = modulePackageJsonContent.peerDependencies || {};
45
46
+ for (let peerDependency in modulePeerDependencies) {
47
+ let dependencyVersion = modulePeerDependencies[peerDependency] || "*";
48
+ await this.$npm.install(`${peerDependency}@${dependencyVersion}`, projectDir, {
49
+ 'save-dev': true
50
+ });
51
+ }
52
}
53
54
await this.$pluginsService.add('nativescript-unit-test-runner', this.$projectData);
0 commit comments