@@ -13,13 +13,13 @@ import { NodeFileSystem } from 'langium/node';
1313describe ( 'A requirement identifier and a test identifier shall contain a number.' , ( ) => {
1414 test ( 'T001_good_case' , async ( ) => {
1515 const services = createRequirementsAndTestsLangServices ( NodeFileSystem ) ;
16- const [ mainDoc , allDocs ] = await extractDocuments (
16+ const [ mainDoc , allDocs ] = await extractDocuments (
1717 path . join ( __dirname , 'files' , 'good' , 'requirements.req' ) ,
1818 services . requirements
1919 ) ;
2020 expect ( ( mainDoc . diagnostics ?? [ ] ) ) . toEqual ( [ ] ) ;
2121 expect ( allDocs . length ) . toEqual ( 3 ) ;
22- allDocs . forEach ( doc => {
22+ allDocs . forEach ( doc => {
2323 expect ( ( doc . diagnostics ?? [ ] ) ) . toEqual ( [ ] ) ;
2424 } ) ;
2525 } ) ;
@@ -35,7 +35,7 @@ describe('A requirement identifier shall contain a number.', () => {
3535 expect ( mainDoc . diagnostics ?? [ ] ) . toEqual ( expect . arrayContaining ( [
3636 expect . objectContaining ( {
3737 message : expect . stringMatching ( 'Requirement name ReqIdABC_reqID should container a number' ) ,
38- range : expect . objectContaining ( { start :expect . objectContaining ( { line : 2 } ) } ) // zero based
38+ range : expect . objectContaining ( { start : expect . objectContaining ( { line : 2 } ) } ) // zero based
3939 } )
4040 ] ) ) ;
4141
@@ -45,17 +45,17 @@ describe('A requirement identifier shall contain a number.', () => {
4545describe ( 'A test identifier shall contain a number.' , ( ) => {
4646 test ( 'T003_badTstId: bad case' , async ( ) => {
4747 const services = createRequirementsAndTestsLangServices ( NodeFileSystem ) ;
48- const [ , allDocs ] = await extractDocuments (
48+ const [ , allDocs ] = await extractDocuments (
4949 path . join ( __dirname , 'files' , 'bad1' , 'requirements.req' ) ,
5050 services . requirements
5151 ) ;
52- const doc = allDocs . find ( doc => / t e s t s _ p a r t 1 .t s t / . test ( doc . uri . fsPath ) ) ;
52+ const doc = allDocs . find ( doc => / t e s t s _ p a r t 1 .t s t / . test ( doc . uri . fsPath ) ) ;
5353 expect ( doc ) . toBeDefined ( ) ;
5454 if ( ! doc ) throw new Error ( 'impossible' ) ;
5555 expect ( doc . diagnostics ?? [ ] ) . toEqual ( expect . arrayContaining ( [
5656 expect . objectContaining ( {
5757 message : expect . stringMatching ( 'Test name TA should container a number.' ) ,
58- range : expect . objectContaining ( { start :expect . objectContaining ( { line : 1 } ) } ) // zero based
58+ range : expect . objectContaining ( { start : expect . objectContaining ( { line : 1 } ) } ) // zero based
5959 } )
6060 ] ) ) ;
6161 } ) ;
@@ -71,7 +71,7 @@ describe('A requirement shall be covered by at least one test.', () => {
7171 expect ( mainDoc . diagnostics ?? [ ] ) . toEqual ( expect . arrayContaining ( [
7272 expect . objectContaining ( {
7373 message : expect . stringMatching ( 'Requirement ReqId004_unicorn not covered by a test.' ) ,
74- range : expect . objectContaining ( { start :expect . objectContaining ( { line : 4 } ) } ) // zero based
74+ range : expect . objectContaining ( { start : expect . objectContaining ( { line : 4 } ) } ) // zero based
7575 } )
7676 ] ) ) ;
7777 } ) ;
@@ -80,28 +80,32 @@ describe('A requirement shall be covered by at least one test.', () => {
8080describe ( 'A referenced environment in a test must be found in one of the referenced requirements.' , ( ) => {
8181 test ( 'referenced environment test' , async ( ) => {
8282 const services = createRequirementsAndTestsLangServices ( NodeFileSystem ) ;
83- const [ , allDocs ] = await extractDocuments (
83+ const [ , allDocs ] = await extractDocuments (
8484 path . join ( __dirname , 'files' , 'bad2' , 'requirements.req' ) ,
8585 services . requirements
8686 ) ;
87- const doc = allDocs . find ( doc => / t e s t s _ p a r t 1 .t s t / . test ( doc . uri . fsPath ) ) ;
87+ const doc = allDocs . find ( doc => / t e s t s _ p a r t 1 .t s t / . test ( doc . uri . fsPath ) ) ;
8888 expect ( doc ) . toBeDefined ( ) ;
8989 if ( ! doc ) throw new Error ( 'impossible' ) ;
9090 expect ( ( doc . diagnostics ?? [ ] ) ) . toEqual ( expect . arrayContaining ( [
9191 expect . objectContaining ( {
9292 message : expect . stringMatching ( 'Test T002_badReqId references environment Linux_x86 which is used in any referenced requirement.' ) ,
93- range : expect . objectContaining ( { start :expect . objectContaining ( {
94- line : 3 ,
95- character : 65
96- } ) } ) // zero based
93+ range : expect . objectContaining ( {
94+ start : expect . objectContaining ( {
95+ line : 3 ,
96+ character : 65
97+ } )
98+ } ) // zero based
9799 } )
98100 ] ) ) ;
99101 expect ( ( doc . diagnostics ?? [ ] ) ) . toEqual ( expect . arrayContaining ( [
100102 expect . objectContaining ( {
101103 message : expect . stringMatching ( 'Test T004_cov references environment Linux_x86 which is used in any referenced requirement.' ) ,
102- range : expect . objectContaining ( { start :expect . objectContaining ( {
103- line : 5
104- } ) } ) // zero based
104+ range : expect . objectContaining ( {
105+ start : expect . objectContaining ( {
106+ line : 5
107+ } )
108+ } ) // zero based
105109 } )
106110 ] ) ) ;
107111
0 commit comments