mirror of
https://github.com/nvbn/thefuck.git
synced 2025-10-11 22:34:01 +01:00
#N/A: Add npm_missing_script
rule
This commit is contained in:
26
tests/specific/test_npm.py
Normal file
26
tests/specific/test_npm.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from io import BytesIO
|
||||
|
||||
import pytest
|
||||
from thefuck.specific.npm import get_scripts
|
||||
|
||||
run_script_stdout = b'''
|
||||
Lifecycle scripts included in code-view-web:
|
||||
test
|
||||
jest
|
||||
|
||||
available via `npm run-script`:
|
||||
build
|
||||
cp node_modules/ace-builds/src-min/ -a resources/ace/ && webpack --progress --colors -p --config ./webpack.production.config.js
|
||||
develop
|
||||
cp node_modules/ace-builds/src/ -a resources/ace/ && webpack-dev-server --progress --colors
|
||||
watch-test
|
||||
jest --verbose --watch
|
||||
|
||||
'''
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('no_memoize')
|
||||
def test_get_scripts(mocker):
|
||||
patch = mocker.patch('thefuck.specific.npm.Popen')
|
||||
patch.return_value.stdout = BytesIO(run_script_stdout)
|
||||
assert get_scripts() == ['build', 'develop', 'watch-test']
|
Reference in New Issue
Block a user