Skip to content

Commit

Permalink
Added test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
aayushRedHat committed Jan 9, 2024
1 parent b182d0f commit beacf2d
Show file tree
Hide file tree
Showing 26 changed files with 32,998 additions and 1 deletion.
37 changes: 37 additions & 0 deletions lib/asyncapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
asyncapi: 2.5.0
info:
title: Streetlights API Simplified
version: 1.0.0
description: |
The Smartylighting Streetlights API allows you to remotely manage the city lights.
This is a simplified version of the Streetlights API from other examples. This version is used in AsyncAPI documentation.
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
mosquitto:
url: mqtt://test.mosquitto.org
protocol: mqtt
channels:
light/measured:
publish:
summary: Inform about environmental lighting conditions for a particular streetlight.
operationId: onLightMeasured
message:
name: LightMeasured
payload:
type: object
properties:
id:
type: integer
minimum: 0
description: Id of the streetlight.
lumens:
type: integer
minimum: 0
description: Light intensity measured in lumens.
sentAt:
type: string
format: date-time
description: Date and time when the message was sent.
8 changes: 8 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

const path = require('path');
const tempOutputResults = '../temp/integrationTestResult';
const outputDir = path.resolve(tempOutputResults, Math.random().toString(36).substring(7));
const templateName = '@asyncapi/html-template';
const Generator = require('../lib/generator');
const gen = new Generator(templateName, outputDir, __dirname, {debug: true, registry: {url: 'http://localhost:4873/', username: 'admin', password: 'nimda'}});
console.log(gen.installTemplate());
1 change: 0 additions & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ utils.getGeneratorVersion = () => {
return packageJson.version;
};


/**
* Determine whether the given function is asynchronous.
* @private
Expand Down
1 change: 1 addition & 0 deletions test/test-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"test": "npm run test:cleanup && npm run test:project && npm run test:global",
"test:project": "jest --detectOpenHandles --testPathIgnorePatterns=test-global --modulePathIgnorePatterns='./__mocks__'",
"test:global": "jest --detectOpenHandles --testPathPattern=test-global --modulePathIgnorePatterns='./__mocks__'",
"test:registry": "jest --detectOpenHandles --testPathPattern=test-global --modulePathIgnorePatterns='./__mocks__'",
"test:cleanup": "rimraf \"../temp\""
},
"dependencies": {
Expand Down
Loading

0 comments on commit beacf2d

Please sign in to comment.