@@ -44,21 +44,70 @@ jobs:
4444 id : npm-ci-test
4545 run : npm run ci-test
4646
47- test-action :
48- name : GitHub Actions Test
47+ positive-tests :
48+ name : Positive Action Tests
4949 runs-on : ubuntu-latest
50-
5150 steps :
5251 - name : Checkout
53- id : checkout
5452 uses : actions/checkout@v4
5553
56- - name : Test Local Action
57- id : test-action
54+ - name : Test direct text (not case-sensitive)
55+ id : test-direct-text
56+ uses : ./
57+ with :
58+ text : " Hey @PrOfEssortocat, I'm finished with my task"
59+ keyphrase : ' @professortocat'
60+
61+ - name : Test text file (not case-sensitive)
62+ id : test-text-file
63+ uses : ./
64+ with :
65+ text-file : ./__tests__/test-mixed-case.md
66+ keyphrase : ' github'
67+ minimum-occurrences : ' 3'
68+
69+ negative-tests :
70+ name : Negative Action Tests
71+ runs-on : ubuntu-latest
72+ steps :
73+ - uses : actions/checkout@v4
74+ - name : Test direct text (case-sensitive)
75+ id : test-direct-text
76+ continue-on-error : true
77+ uses : ./
78+ with :
79+ text : " Hey @PrOfEssortocat, I'm finished with my task"
80+ keyphrase : ' @professortocat'
81+ case-sensitive : true
82+
83+ - name : Check output for direct text test
84+ run : |
85+ if [[ "${{ steps.test-direct-text.outcome }}" != "failure" ]]; then
86+ echo "Expected the test to fail but it passed"
87+ exit 1
88+ fi
89+ if [[ "${{ steps.test-direct-text.outputs.occurrences }}" != "0" ]]; then
90+ echo "Expected 0 occurrences but found ${{ steps.test-direct-text.outputs.occurrences }}"
91+ exit 1
92+ fi
93+
94+ - name : Test text file (case-sensitive)
95+ id : test-text-file
96+ continue-on-error : true
5897 uses : ./
5998 with :
60- milliseconds : 2000
99+ text-file : ./__tests__/test-mixed-case.md
100+ keyphrase : ' github'
101+ minimum-occurrences : 3
102+ case-sensitive : true
61103
62- - name : Print Output
63- id : output
64- run : echo "${{ steps.test-action.outputs.time }}"
104+ - name : Check output for text file test
105+ run : |
106+ if [[ "${{ steps.test-text-file.outcome }}" != "failure" ]]; then
107+ echo "Expected the test to fail but it passed"
108+ exit 1
109+ fi
110+ if [[ "${{ steps.test-text-file.outputs.occurrences }}" != "1" ]]; then
111+ echo "Expected 1 occurrences but found ${{ steps.test-text-file.outputs.occurrences }}"
112+ exit 1
113+ fi
0 commit comments