Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-yin committed Apr 25, 2024
1 parent 9d8f42c commit 96422e1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ def npm_project_path(tmp_path, request):
)
print(result.stdout, result.stderr)

# create another entrypoint file
app_test_content = """
// This is a simple test script
console.log('Hello from app_test.js');
"""
app_test_path = frontend_project_path / "src" / "application" / "app_test.js"
app_test_path.write_text(app_test_content)

yield frontend_project_path


Expand Down
4 changes: 2 additions & 2 deletions tests/tests_django/es6_scss/test_django.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def test_django(settings, npm_project_path, npm_build_commands):
stylesheet_pack,
)

html = javascript_pack("app", "app2")
html = javascript_pack("app", "app_test")
assert re.findall(r"app[.\w]*?.js", html)
assert re.findall(r"app2[.\w]*?.js", html)
assert re.findall(r"app_test[.\w]*?.js", html)
# also load dependency
assert len(re.findall(r"<script", html)) > 2

Expand Down
2 changes: 1 addition & 1 deletion tests/tests_django/es6_scss/test_npm_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def test_npm(npm_project_path, npm_build_commands):
assert len(js_files) > 0
js_files = ", ".join(js_files)
assert re.findall(r"app[.\w]*?.js", js_files)
assert re.findall(r"app2[.\w]*?.js", js_files)
assert re.findall(r"app_test[.\w]*?.js", js_files)

css_path = npm_project_path / "build" / "css"
css_files = list(css_path.glob("*.*"))
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_flask/es6_scss/test_flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def test_flask(config, npm_project_path, npm_build_commands):

from webpack_boilerplate.contrib.jinja2ext import javascript_pack, stylesheet_pack

html = javascript_pack("app", "app2")
html = javascript_pack("app", "app_test")
assert re.findall(r"app[.\w]*?.js", html)
assert re.findall(r"app2[.\w]*?.js", html)
assert re.findall(r"app_test[.\w]*?.js", html)
# also load dependency
assert len(re.findall(r"<script", html)) > 2

Expand Down

0 comments on commit 96422e1

Please sign in to comment.