Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,5 @@ bazel-*

.DS_Store
.idea/*
test-results
.local
12 changes: 7 additions & 5 deletions tests/test_runners/test_codeceptjs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
from smart_tests.utils.http_client import get_base_url
from tests.cli_test_case import CliTestCase

_TOKEN = {"SMART_TESTS_TOKEN": CliTestCase.smart_tests_token}


class CodeceptjsTest(CliTestCase):
@responses.activate
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.smart_tests_token})
@mock.patch.dict(os.environ, _TOKEN)
def test_record_test_codeceptjs(self):
result = self.cli(
"record",
Expand All @@ -27,7 +29,7 @@ def test_record_test_codeceptjs(self):
self.assert_record_tests_payload("record_test_result.json")

@responses.activate
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.smart_tests_token})
@mock.patch.dict(os.environ, _TOKEN)
def test_subset(self):
"""Test basic subset functionality with multiple test files"""
pipe = "test/example_test.js\ntest/login_test.js\n"
Expand Down Expand Up @@ -70,7 +72,7 @@ def test_subset(self):
)

@responses.activate
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.smart_tests_token})
@mock.patch.dict(os.environ, _TOKEN)
def test_subset_with_rest(self):
"""Test subset functionality with --rest option to save remaining tests"""
pipe = "test/example_test.js\ntest/other_test.js\n"
Expand Down Expand Up @@ -132,7 +134,7 @@ def test_subset_with_rest(self):
Path(rest_file_path).unlink()

@responses.activate
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.smart_tests_token})
@mock.patch.dict(os.environ, _TOKEN)
def test_subset_with_single_test(self):
"""Test subset functionality with a single test file"""
pipe = "test/single_test.js\n"
Expand Down Expand Up @@ -172,7 +174,7 @@ def test_subset_with_single_test(self):
self.assertEqual(output_json["tests"], ["test/single_test.js"])

@responses.activate
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.smart_tests_token})
@mock.patch.dict(os.environ, _TOKEN)
def test_subset_strips_newlines(self):
"""Test that subset properly strips newlines from test paths"""
# Test with various newline formats
Expand Down
Loading