Skip to content

Commit 3ba127e

Browse files
committed
Added a test
1 parent 5d6c939 commit 3ba127e

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"testPaths": [
3+
[
4+
{
5+
"type": "file",
6+
"name": "a.ts"
7+
}
8+
],
9+
[
10+
{
11+
"type": "file",
12+
"name": "b.ts"
13+
}
14+
]
15+
],
16+
"testRunner": "karma",
17+
"session": { "id": "16" },
18+
"goal": {"type": "subset-by-percentage", "percentage": 0.1},
19+
"ignoreNewTests": false,
20+
"getTestsFromGuess": false,
21+
"getTestsFromPreviousSessions": false
22+
}

tests/test_runners/test_karma.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import responses # type: ignore
55

6+
from launchable.utils.session import write_build
67
from tests.cli_test_case import CliTestCase
78

89

@@ -16,3 +17,14 @@ def test_record_tests_json(self):
1617

1718
self.assert_success(result)
1819
self.assert_record_tests_payload('record_test_result.json')
20+
21+
@responses.activate
22+
@mock.patch.dict(os.environ, {"LAUNCHABLE_TOKEN": CliTestCase.launchable_token})
23+
def test_subset(self):
24+
# emulate launchable record build
25+
write_build(self.build_name)
26+
27+
result = self.cli('subset', '--target', '10%', '--base',
28+
os.getcwd(), 'karma', '--with', 'ng', input="a.ts\nb.ts")
29+
self.assert_success(result)
30+
self.assert_subset_payload('subset_result.json')

0 commit comments

Comments
 (0)