@@ -103,7 +103,7 @@ database is not something we want to clean before each test it's handy to use an
103103independent in-memory datasource which is filled appropriately using
104104[ test data builders] ( #use-test-data-builders ) before each test run.
105105
106- {% include code-caption.html content="test /fixtures/datasources/testdb.datasource.ts" %}
106+ {% include code-caption.html content="src/ __ tests __ /fixtures/datasources/testdb.datasource.ts" %}
107107
108108``` ts
109109import {juggler } from ' @loopback/repository' ;
@@ -126,7 +126,7 @@ database in the state that caused the test to fail.
126126To clean the database before each test, set up a ` beforeEach ` hook to call a
127127helper method; for example:
128128
129- {% include code-caption.html content="test /helpers/database.helpers.ts" %}
129+ {% include code-caption.html content="src/ __ tests __ /helpers/database.helpers.ts" %}
130130
131131``` ts
132132import {ProductRepository , CategoryRepository } from ' ../../src/repositories' ;
@@ -141,7 +141,7 @@ export async function givenEmptyDatabase() {
141141In case a repository includes a relation to another repository, ie. Product
142142belongs to Category, include it in the repository call, for example:
143143
144- {% include code-caption.html content="test /helpers/database.helpers.ts" %}
144+ {% include code-caption.html content="src/ __ tests __ /helpers/database.helpers.ts" %}
145145
146146``` ts
147147import {Getter } from ' @loopback/context' ;
@@ -160,7 +160,7 @@ export async function givenEmptyDatabase() {
160160}
161161```
162162
163- {% include code-caption.html content="test /integration/controllers/product.controller.integration.ts" %}
163+ {% include code-caption.html content="src/ __ tests __ /integration/controllers/product.controller.integration.ts" %}
164164
165165``` ts
166166// in your test file
@@ -198,7 +198,7 @@ documents.
198198In practice, a simple function that adds missing required properties is
199199sufficient.
200200
201- {% include code-caption.html content="test /helpers/database.helpers.ts" %}
201+ {% include code-caption.html content="src/ __ tests __ /helpers/database.helpers.ts" %}
202202
203203``` ts
204204// ...
@@ -432,7 +432,7 @@ implementation of its repository dependency using the `testlab`
432432[ Create a stub repository] ( #create-a-stub-repository ) for a detailed
433433explanation.
434434
435- {% include code-caption.html content="test /unit/controllers/product.controller.unit.ts" %}
435+ {% include code-caption.html content="src/ __ tests __ /unit/controllers/product.controller.unit.ts" %}
436436
437437``` ts
438438import {
@@ -482,7 +482,7 @@ unit tests to verify the implementation of this additional method.
482482Remember to use [ Test data builders] ( #use-test-data-builders ) whenever you need
483483valid data to create a new model instance.
484484
485- {% include code-caption.html content="test /unit/models/person.model.unit.ts" %}
485+ {% include code-caption.html content="src/ __ tests __ /unit/models/person.model.unit.ts" %}
486486
487487``` ts
488488import {Person } from ' ../../../src/models' ;
@@ -569,7 +569,7 @@ Integration tests are one of the places to put the best practices in
569569Here is an example showing how to write an integration test for a custom
570570repository method ` findByName ` :
571571
572- {% include code-caption.html content="test /integration/repositories/category.repository.integration.ts" %}
572+ {% include code-caption.html content="src/ __ tests __ /integration/repositories/category.repository.integration.ts" %}
573573
574574``` ts
575575import {
@@ -604,7 +604,7 @@ commands and queries produce expected results when executed on a real database.
604604These tests are similar to repository tests with controllers added as another
605605ingredient.
606606
607- {% include code-caption.html content="test /integration/controllers/product.controller.integration.ts" %}
607+ {% include code-caption.html content="src/ __ tests __ /integration/controllers/product.controller.integration.ts" %}
608608
609609``` ts
610610import {expect } from ' @loopback/testlab' ;
@@ -742,10 +742,9 @@ provides a helper method `validateApiSpec` that builds on top of the popular
742742
743743Example usage:
744744
745- {% include code-caption.html content= "test /acceptance/api-spec.acceptance.ts" %}
745+ {% include code-caption.html content= "src/ __ tests __ /acceptance/api-spec.acceptance.ts" %}
746746
747747``` ts
748- // test/acceptance/api-spec.test.ts
749748import {HelloWorldApplication } from ' ../..' ;
750749import {RestServer } from ' @loopback/rest' ;
751750import {validateApiSpec } from ' @loopback/testlab' ;
@@ -785,7 +784,7 @@ developers consuming your API will find them useful too.
785784
786785Here is an example showing how to run Dredd to test your API against the spec:
787786
788- {% include code-caption.html content= "test /acceptance/api-spec.acceptance.ts" %}
787+ {% include code-caption.html content= "src/ __ tests __ /acceptance/api-spec.acceptance.ts" %}
789788
790789``` ts
791790import {expect } from ' @loopback/testlab' ;
@@ -857,7 +856,7 @@ two tests (one test for each user role).
857856
858857Here is an example of an acceptance test:
859858
860- {% include code-caption.html content= "test /acceptance/product.acceptance.ts" %}
859+ {% include code-caption.html content= "src/ __ tests __ /acceptance/product.acceptance.ts" %}
861860
862861``` ts
863862import {HelloWorldApplication } from ' ../..' ;
0 commit comments