From 55de06067c75a8c0adbdc137506e674f8ae1ca79 Mon Sep 17 00:00:00 2001 From: Lukasz Gornicki Date: Mon, 16 Dec 2024 23:38:18 +0100 Subject: [PATCH] fix paths for tests --- apps/generator/test/integration.test.js | 8 ++++---- .../react-template/__transpiled/models.js.map | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/generator/test/integration.test.js b/apps/generator/test/integration.test.js index c2df3fac5..0a74aac0d 100644 --- a/apps/generator/test/integration.test.js +++ b/apps/generator/test/integration.test.js @@ -10,11 +10,11 @@ const dummySpecPath = path.resolve(__dirname, './docs/dummy.yml'); const refSpecPath = path.resolve(__dirname, './docs/apiwithref.json'); const refSpecFolder = path.resolve(__dirname, './docs/'); const crypto = require('crypto'); -const mainTestResultPath = 'test/temp/integrationTestResult'; -const reactTemplate = 'test/test-templates/react-template'; -const nunjucksTemplate = 'test/test-templates/nunjucks-template'; +const mainTestResultPath = path.resolve(__dirname, './temp/integrationTestResult'); +const reactTemplate = path.resolve(__dirname, './test-templates/react-template'); +const nunjucksTemplate = path.resolve(__dirname, './test-templates/nunjucks-template'); //temp location where react template is copied for each test that does some mutation on template files -const copyOfReactTemplate = 'test/temp/reactTemplate'; +const copyOfReactTemplate = path.resolve(__dirname, './temp/reactTemplate'); describe('Integration testing generateFromFile() to make sure the result of the generation is not changend comparing to snapshot', () => { const generateFolderName = () => { diff --git a/apps/generator/test/test-templates/react-template/__transpiled/models.js.map b/apps/generator/test/test-templates/react-template/__transpiled/models.js.map index f0953ba73..0c67f82df 100644 --- a/apps/generator/test/test-templates/react-template/__transpiled/models.js.map +++ b/apps/generator/test/test-templates/react-template/__transpiled/models.js.map @@ -1 +1 @@ -{"version":3,"file":"models.js","sources":["../template/models.js"],"sourcesContent":["import { Models } from '@asyncapi/generator-components';\n\nexport default async function({ asyncapi }) {\n return await Models({asyncapi, language: 'csharp'});\n}"],"names":["asyncapi","Models","language"],"mappings":";;;;;AAEe,qBAAe,EAAA;AAAEA,EAAAA,QAAAA;AAAS,CAAC,EAAE;EAC1C,OAAO,MAAMC,0BAAM,CAAC;IAACD,QAAQ;AAAEE,IAAAA,QAAQ,EAAE,QAAA;AAAQ,GAAC,CAAC,CAAA;AACrD;;;;"} \ No newline at end of file +{"version":3,"file":"models.js","sources":["../template/models.js"],"sourcesContent":["//TODO: at the moment this template as devDependency set to \"@asyncapi/generator-components\": \"*\" in generator root but this is temporary to not complicate one PR too much. We still need to explore concept of having just one dependency in the template pointing to @asyncapi/generator and noting else, and components, react sdks and others should be just part of @asyncapi/generator dependency\nimport { Models } from '@asyncapi/generator-components';\n\nexport default async function({ asyncapi }) {\n return await Models({asyncapi, language: 'csharp'});\n}"],"names":["asyncapi","Models","language"],"mappings":";;;;;AAGe,qBAAe,EAAA;AAAEA,EAAAA,QAAAA;AAAS,CAAC,EAAE;EAC1C,OAAO,MAAMC,0BAAM,CAAC;IAACD,QAAQ;AAAEE,IAAAA,QAAQ,EAAE,QAAA;AAAQ,GAAC,CAAC,CAAA;AACrD;;;;"} \ No newline at end of file