From 0fb45772f9ccc71308f321b400a84369972f2971 Mon Sep 17 00:00:00 2001 From: Nils Knappmeier Date: Wed, 10 Feb 2016 16:31:22 +0100 Subject: [PATCH] Create borders around markdown-tables Closes bootprint-openapi#52 - Marked is now configured so that tables are rendered with the classes "table table-bordered" to make them look more like the swagger-editor --- test/table-in-description/swagger.yaml | 20 ++++++++++++++++ .../table-in-description-spec.js | 23 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 test/table-in-description/swagger.yaml create mode 100644 test/table-in-description/table-in-description-spec.js diff --git a/test/table-in-description/swagger.yaml b/test/table-in-description/swagger.yaml new file mode 100644 index 0000000..78b1726 --- /dev/null +++ b/test/table-in-description/swagger.yaml @@ -0,0 +1,20 @@ +# this is an example of the Uber API +# as a demonstration of an API spec in YAML +swagger: '2.0' +info: + title: Test + description: | + | A | B | + | --------- | ---------- | + | someKey | SomeValue | + version: "1.0.0" +# the domain of the service +host: api.uber.com +# array of all schemes that your API supports +schemes: + - https +# will be prefixed to all paths +basePath: /v1 +produces: + - application/json +paths: [] diff --git a/test/table-in-description/table-in-description-spec.js b/test/table-in-description/table-in-description-spec.js new file mode 100644 index 0000000..3b1552a --- /dev/null +++ b/test/table-in-description/table-in-description-spec.js @@ -0,0 +1,23 @@ +/*! + * bootprint-swagger + * + * Copyright (c) 2015 Nils Knappmeier. + * Released under the MIT license. + */ + +/* global describe */ +/* global it */ +/* global before */ +var expect = require('chai').expect +var core = require('../core') + +describe('The response-examples fixture', function () { + this.timeout(10000) + var context = {} + before(function () { + return core.run(require.resolve('./swagger.yaml'), __dirname, context) + }) + it('should render tables inside markdown with borders', function () { + expect(context.$('table').first().attr('class')).to.equal('table table-bordered') + }) +})