File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed
Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22
3+ # Skip tests during rebase
4+ if [ -d .git/rebase-merge ] || [ -d .git/rebase-apply ]; then
5+ exit 0
6+ fi
7+
38echo " Checking for modified courses..."
49
510# Get list of staged files
Original file line number Diff line number Diff line change @@ -45,8 +45,7 @@ describe("QA Tests", () => {
4545 return targetCourses . some ( ( term ) => slug . includes ( term ) ) ;
4646 } ) ;
4747 console . log (
48- `Filtering QA tests to courses matching: ${ coursePaths . join ( ", " ) } (${
49- coursePaths . length
48+ `Filtering QA tests to courses matching: ${ coursePaths . join ( ", " ) } (${ coursePaths . length
5049 } )`
5150 ) ;
5251 }
@@ -360,9 +359,9 @@ describe("QA Tests", () => {
360359 it ( "should be optional, mark as read or have one or more questions" , ( ) => {
361360 expect (
362361 optional ||
363- hasReadButton ||
364- includesSandbox ||
365- questionPaths . length > 0
362+ hasReadButton ||
363+ includesSandbox ||
364+ questionPaths . length > 0
366365 ) . toBe ( true ) ;
367366 } ) ;
368367
@@ -439,6 +438,20 @@ describe("QA Tests", () => {
439438 expect ( titleMatch [ 1 ] . trim ( ) . length ) . toBeGreaterThan ( 0 ) ;
440439 } ) ;
441440
441+ it ( "should not have its title appear in the lesson content" , ( ) => {
442+ const titleMatch = asciidoc . match ( / ^ = \s + ( .+ ) $ / m) ;
443+ if ( titleMatch ) {
444+ const title = titleMatch [ 1 ] . trim ( ) ;
445+
446+ // Check if the question title appears in the lesson content
447+ if ( lessonAdoc . includes ( `= ${ title } \n` ) ) {
448+ throw new Error (
449+ `Question title "${ title } " should not appear in the lesson content`
450+ ) ;
451+ }
452+ }
453+ } ) ;
454+
442455 it ( `should have a hint` , ( ) => {
443456 expect ( asciidoc ) . toContain ( "\n[TIP,role=hint]" ) ;
444457 } ) ;
You can’t perform that action at this time.
0 commit comments