-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TEST] Add test for
DangerSwiftCommitLint
- improve testability
- Loading branch information
Wei Sun
authored and
Wei Sun
committed
Sep 8, 2021
1 parent
298e917
commit dbe315d
Showing
8 changed files
with
325 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
Tests/DangerSwiftCommitLintTests/CommitChecker/Fixtures/GitIssuesOnLastTwoCommits.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
let gitIssuesOnLastTwoCommitsJSON = """ | ||
{ | ||
"modified_files": [ | ||
"Tests/SampleTest.swift" | ||
], | ||
"created_files": [], | ||
"deleted_files": [], | ||
"commits": [ | ||
{ | ||
"sha": "testshacommit4", | ||
"author": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2021-09-08T23:16:13.000Z" | ||
}, | ||
"committer": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2019-04-10T21:56:43.000Z" | ||
}, | ||
"message": "Hi", | ||
"parents": [], | ||
"url": "https://gitlab.com/test/test.systems/commit/testshacommit4", | ||
"tree": null | ||
}, | ||
{ | ||
"sha": "testshacommit3", | ||
"author": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2021-09-08T21:56:43.000Z" | ||
}, | ||
"committer": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2019-04-10T21:56:43.000Z" | ||
}, | ||
"message": "subject for test purpose - commit 3 very very long commit subject.\\nTest Body Line 1.\\nTest Body Line 2.", | ||
"parents": [], | ||
"url": "https://gitlab.com/test/test.systems/commit/testshacommit3", | ||
"tree": null | ||
}, | ||
{ | ||
"sha": "testshacommit2", | ||
"author": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2021-09-08T20:10:33.000Z" | ||
}, | ||
"committer": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2019-04-10T20:10:33.000Z" | ||
}, | ||
"message": "Merge branch 'master' into TestRepository/tt/tech-123-update-sample-test", | ||
"parents": [], | ||
"url": "https://gitlab.com/test/test.systems/commit/testshacommit2", | ||
"tree": null | ||
}, | ||
{ | ||
"sha": "testshacommit1", | ||
"author": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2021-09-08T16:23:31.000Z" | ||
}, | ||
"committer": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2019-04-10T16:23:31.000Z" | ||
}, | ||
"message": "Subject for test purpose - commit 1\\n\\nTest Body Line 1.\\nTest Body Line 2.", | ||
"parents": [], | ||
"url": "https://gitlab.com/test/test.systems/commit/testshacommit1", | ||
"tree": null | ||
} | ||
] | ||
} | ||
""" |
62 changes: 62 additions & 0 deletions
62
Tests/DangerSwiftCommitLintTests/CommitChecker/Fixtures/GitJSON.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
let gitJSON = """ | ||
{ | ||
"modified_files": [ | ||
"Tests/SampleTest.swift" | ||
], | ||
"created_files": [], | ||
"deleted_files": [], | ||
"commits": [ | ||
{ | ||
"sha": "testshacommit3", | ||
"author": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2021-09-08T21:56:43.000Z" | ||
}, | ||
"committer": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2019-04-10T21:56:43.000Z" | ||
}, | ||
"message": "Subject for test purpose - commit 3\\n\\nTest Body Line 1.\\nTest Body Line 2.", | ||
"parents": [], | ||
"url": "https://gitlab.com/test/test.systems/commit/testshacommit3", | ||
"tree": null | ||
}, | ||
{ | ||
"sha": "testshacommit2", | ||
"author": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2021-09-08T20:10:33.000Z" | ||
}, | ||
"committer": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2019-04-10T20:10:33.000Z" | ||
}, | ||
"message": "Subject for test purpose - commit 2\\n\\nTest Body Line 1.\\nTest Body Line 2.", | ||
"parents": [], | ||
"url": "https://gitlab.com/test/test.systems/commit/testshacommit2", | ||
"tree": null | ||
}, | ||
{ | ||
"sha": "testshacommit1", | ||
"author": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2021-09-08T16:23:31.000Z" | ||
}, | ||
"committer": { | ||
"name": "Test Testy", | ||
"email": "[email protected]", | ||
"date": "2019-04-10T16:23:31.000Z" | ||
}, | ||
"message": "Subject for test purpose - commit 1\\n\\nTest Body Line 1.\\nTest Body Line 2.", | ||
"parents": [], | ||
"url": "https://gitlab.com/test/test.systems/commit/testshacommit1", | ||
"tree": null | ||
} | ||
] | ||
} | ||
""" |
Oops, something went wrong.