|
17 | 17 | from pre_commit.hook import Hook |
18 | 18 | from pre_commit.languages import golang |
19 | 19 | from pre_commit.languages import helpers |
20 | | -from pre_commit.languages import node |
21 | 20 | from pre_commit.languages import python |
22 | 21 | from pre_commit.languages.all import languages |
23 | 22 | from pre_commit.prefix import Prefix |
@@ -193,38 +192,6 @@ def test_run_a_docker_image_hook(tempdir_factory, store, hook_id): |
193 | 192 | ) |
194 | 193 |
|
195 | 194 |
|
196 | | -def test_run_a_node_hook(tempdir_factory, store): |
197 | | - _test_hook_repo( |
198 | | - tempdir_factory, store, 'node_hooks_repo', |
199 | | - 'foo', [os.devnull], b'Hello World\n', |
200 | | - ) |
201 | | - |
202 | | - |
203 | | -def test_run_a_node_hook_default_version(tempdir_factory, store): |
204 | | - # make sure that this continues to work for platforms where node is not |
205 | | - # installed at the system |
206 | | - with mock.patch.object( |
207 | | - node, |
208 | | - 'get_default_version', |
209 | | - return_value=C.DEFAULT, |
210 | | - ): |
211 | | - test_run_a_node_hook(tempdir_factory, store) |
212 | | - |
213 | | - |
214 | | -def test_run_versioned_node_hook(tempdir_factory, store): |
215 | | - _test_hook_repo( |
216 | | - tempdir_factory, store, 'node_versioned_hooks_repo', |
217 | | - 'versioned-node-hook', [os.devnull], b'v9.3.0\nHello World\n', |
218 | | - ) |
219 | | - |
220 | | - |
221 | | -def test_node_hook_with_npm_userconfig_set(tempdir_factory, store, tmpdir): |
222 | | - cfg = tmpdir.join('cfg') |
223 | | - cfg.write('cache=/dne\n') |
224 | | - with mock.patch.dict(os.environ, NPM_CONFIG_USERCONFIG=str(cfg)): |
225 | | - test_run_a_node_hook(tempdir_factory, store) |
226 | | - |
227 | | - |
228 | 195 | def test_system_hook_with_spaces(tempdir_factory, store): |
229 | 196 | _test_hook_repo( |
230 | 197 | tempdir_factory, store, 'system_hook_with_spaces_repo', |
@@ -482,17 +449,6 @@ def test_repository_state_compatibility(tempdir_factory, store, v): |
482 | 449 | assert _hook_installed(hook) is True |
483 | 450 |
|
484 | 451 |
|
485 | | -def test_additional_node_dependencies_installed(tempdir_factory, store): |
486 | | - path = make_repo(tempdir_factory, 'node_hooks_repo') |
487 | | - config = make_config_from_repo(path) |
488 | | - # Careful to choose a small package that's not depped by npm |
489 | | - config['hooks'][0]['additional_dependencies'] = ['lodash'] |
490 | | - hook = _get_hook(config, store, 'foo') |
491 | | - with node.in_env(hook.prefix, hook.language_version): |
492 | | - output = cmd_output('npm', 'ls', '-g')[1] |
493 | | - assert 'lodash' in output |
494 | | - |
495 | | - |
496 | 452 | def test_additional_golang_dependencies_installed( |
497 | 453 | tempdir_factory, store, |
498 | 454 | ): |
|
0 commit comments