boats
Version:
Beautiful Open / Async Template System - Write less yaml with BOATS and Nunjucks.
38 lines (37 loc) • 2.23 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const autoSummary_1 = tslib_1.__importDefault(require("../autoSummary"));
it('should return just the method', async () => {
expect((0, autoSummary_1.default)('get.yml')).toBe('Get');
});
it('should return the method with User', async () => {
expect((0, autoSummary_1.default)('user/get.yml')).toBe('Get user');
});
it('user/{id}/get.yml', async () => {
expect((0, autoSummary_1.default)('user/{id}/get.yml')).toBe('Get user based on {id}');
});
it('house/{number}/user/{id}/get.yml', async () => {
expect((0, autoSummary_1.default)('house/{number}/user/{id}/get.yml')).toBe('Get user based on {id}, from house {number}');
});
it('street/{name}/house/{number}/user/{id}/get.yml', async () => {
expect((0, autoSummary_1.default)('street/{name}/house/{number}/user/{id}/get.yml')).toBe('Get user based on {id}, from house {number}, from street {name}');
});
it('streets/location/houses/get.yml', async () => {
expect((0, autoSummary_1.default)('streets/location/houses/get.yml')).toBe('Get houses, from location, from streets');
});
it('/streets/location/houses/get.yml', async () => {
expect((0, autoSummary_1.default)('streets/location/houses/get.yml')).toBe('Get houses, from location, from streets');
});
it('/streets/location/{name}/house/put.yml', async () => {
expect((0, autoSummary_1.default)('streets/location/{name}/house/put.yml')).toBe('Update a house, from location {name}, from streets');
});
it('/streets/location/{name}/house/patch.yml', async () => {
expect((0, autoSummary_1.default)('streets/location/{name}/house/patch.yml')).toBe('Update part of a house, from location {name}, from streets');
});
it('/streets/location/{name}/house/delete.yml', async () => {
expect((0, autoSummary_1.default)('streets/location/{name}/house/delete.yml')).toBe('Delete a house, from location {name}, from streets');
});
it('leave the name in place /streets/location/{name}/house/out.yml', async () => {
expect((0, autoSummary_1.default)('streets/location/{name}/house/our.yml', { useFileName: true })).toBe(' Our, from house, from location {name}, from streets');
});