<commit_before><?php

namespace Hshn\NpmBundle\Functional;


/**
 * @author <NAME> <<EMAIL>>
 */
class NpmInstallCommandTest extends NpmCommandTestCase
{
    protected function setUp()
    {
        parent::setUp();

        $this->deleteDirectory([
            $this->getBundleNpmDir('FooBundle').'/node_modules',
            $this->getBundleNpmDir('BarBundle').'/node_modules'
        ]);
    }

    /**
     * @test
     */
    public function testInstall()
    {
        $this->assertFileNotExists($this->getBundleNpmDir('FooBundle').'/node_modules/lodash');
        $this->assertFileNotExists($this->getBundleNpmDir('BarBundle').'/node_modules/underscore');

        $output = $this->runCommand(['hshn:npm:install']);

        $this->assertContains('[FooBundle]', $output);
        $this->assertContains('lodash@4.0.0', $output);
        $this->assertContains('[BarBundle]', $output);
        $this->assertContains('underscore@1.8.3', $output);

        $this->assertFileExists($this->getBundleNpmDir('FooBundle').'/node_modules/lodash');
        $this->assertFileExists($this->getBundleNpmDir('BarBundle').'/node_modules/underscore');
    }
}<commit_msg>Added npm install command test with bundle specs<commit_after><?php

namespace Hshn\NpmBundle\Functional;


/**
 * @author <NAME> <<EMAIL>>
 */
class NpmInstallCommandTest extends NpmCommandTestCase
{
    protected function setUp()
    {
        parent::setUp();

        $this->deleteDirectory([
            $this->getBundleNpmDir('FooBundle').'/node_modules',
            $this->getBundleNpmDir('BarBundle').'/node_modules'
        ]);
    }

    /**
     * @test
     */
    public function testInstall()
    {
        $this->assertFileNotExists($this->getBundleNpmDir('FooBundle').'/node_modules/lodash');
        $this->assertFileNotExists($this->getBundleNpmDir('BarBundle').'/node_modules/underscore');

        $output = $this->runCommand(['hshn:npm:install']);

        $this->assertContains('[FooBundle]', $output);
        $this->assertContains('lodash@4.0.0', $output);
        $this->assertContains('[BarBundle]', $output);
        $this->assertContains('underscore@1.8.3', $output);

        $this->assertFileExists($this->getBundleNpmDir('FooBundle').'/node_modules/lodash');
        $this->assertFileExists($this->getBundleNpmDir('BarBundle').'/node_modules/underscore');
    }

    /**
     * @test
     */
    public function testInstallWithBundleSpecifies()
    {
        $this->assertFileNotExists($this->getBundleNpmDir('FooBundle').'/node_modules/lodash');
        $this->assertFileNotExists($this->getBundleNpmDir('BarBundle').'/node_modules/underscore');

        $output = $this->runCommand(['hshn:npm:install', '--bundle=FooBundle']);

        $this->assertContains('[FooBundle]', $output);
        $this->assertContains('lodash@4.0.0', $output);
        $this->assertNotContains('[BarBundle]', $output);
        $this->assertNotContains('underscore@1.8.3', $output);

        $this->assertFileExists($this->getBundleNpmDir('FooBundle').'/node_modules/lodash');
        $this->assertFileNotExists($this->getBundleNpmDir('BarBundle').'/node_modules/underscore');
    }
}
{'fraction_non_alphanumeric': 0.18161648177496037, 'fraction_numerical': 0.005705229793977813, 'mean_word_length': 3.6140350877192984, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3820687', 'n_tokens_mistral': 1024, 'n_tokens_neox': 957, 'n_words': 96}