Skip to content
This repository was archived by the owner on Jun 23, 2019. It is now read-only.

Commit 9d7a75f

Browse files
committed
Merge pull request #7 from refractproject/pksunkara/minim-14
Upgrade to minim 0.14.0 and Release 0.2.2
2 parents b0a5d76 + b0529a3 commit 9d7a75f

File tree

6 files changed

+88
-35
lines changed

6 files changed

+88
-35
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
language: node_js
22
sudo: false
33
node_js:
4+
- '6'
45
- '4'
5-
- '3'
6-
- '2'
7-
- '1'
86
- '0.12'
97
- '0.10'
108
script:

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 0.2.2 - 2016-04-28
2+
3+
- Upgrade minim peerDependency to 0.14.0
4+
- Upgrade minim-api-description dependency to 0.1.4
5+
16
# 0.2.1 - 2015-11-24
27

38
- Fix a bug that was caused by overwriting the base element. This is now accomplished in another way.

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ import parseResult from 'minim-parse-result';
8181
const namespace = minim.namespace()
8282
.use(parseResult);
8383

84-
// Convert from Compact Refract
85-
let compactRefract = ['parseResult', {}, {}, []];
86-
let api = namespace.fromCompactRefract(compactRefract);
87-
8884
// Initialize elements directly
8985
const ParseResult = namespace.getElementClass('parseResult');
9086
let category = new ParseResult();

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "minim-parse-result",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "Minim Parse Result Namespace",
55
"main": "./lib/parse-result.js",
66
"repository": {
@@ -18,12 +18,12 @@
1818
},
1919
"dependencies": {
2020
"babel-runtime": "^5.8.20",
21-
"minim-api-description": "^0.1.0"
21+
"minim-api-description": "^0.1.4"
2222
},
2323
"devDependencies": {
2424
"chai": "^3.2.0",
2525
"coveralls": "^2.11.2",
26-
"minim": "^0.13.0",
26+
"minim": "^0.14.0",
2727
"peasant": "^0.5.2"
2828
},
2929
"author": "Apiary.io <[email protected]>",

src/parse-result.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ export function namespace(options) {
1414
const ArrayElement = minim.getElementClass('array');
1515
const StringElement = minim.getElementClass('string');
1616

17-
// First, modify the default list of special attributes to include
18-
// the new `sourceMap` attribute, which is an unrefracted array of
19-
// refracted source map elements.
20-
minim._attributeElementArrayKeys.push('sourceMap');
21-
2217
class ParseResult extends ArrayElement {
2318
constructor() {
2419
super(...arguments);

test/parse-result.js

Lines changed: 79 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,46 @@ function attrValue(element, name) {
4343
describe('Parse result namespace', () => {
4444
context('parse result element', () => {
4545
let parseResult;
46+
let refracted;
4647

4748
beforeEach(() => {
48-
parseResult = (new ParseResult()).fromCompactRefract([
49-
'parseResult', {}, {}, [
50-
['annotation', {classes: ['warning']}, {}, []],
51-
['annotation', {classes: ['error']}, {}, []],
52-
['category', {classes: ['api']}, {}, []],
49+
refracted = {
50+
element: 'parseResult',
51+
meta: {},
52+
attributes: {},
53+
content: [
54+
{
55+
element: 'annotation',
56+
meta: {
57+
classes: ['warning'],
58+
},
59+
attributes: {},
60+
content: [],
61+
},
62+
{
63+
element: 'annotation',
64+
meta: {
65+
classes: ['error'],
66+
},
67+
attributes: {},
68+
content: [],
69+
},
70+
{
71+
element: 'category',
72+
meta: {
73+
classes: ['api'],
74+
},
75+
attributes: {},
76+
content: [],
77+
},
5378
],
54-
]);
79+
};
80+
81+
parseResult = (new ParseResult()).fromRefract(refracted);
82+
});
83+
84+
it('should round-trip correctly', () => {
85+
expect(parseResult.toRefract()).to.deep.equal(refracted);
5586
});
5687

5788
it('should have element name parseResult', () => {
@@ -93,11 +124,23 @@ describe('Parse result namespace', () => {
93124

94125
context('annotation element', () => {
95126
let annotation;
127+
let refracted;
96128

97129
beforeEach(() => {
98-
annotation = (new Annotation()).fromCompactRefract([
99-
'annotation', {}, {code: 123}, 'Missing argument description',
100-
]);
130+
refracted = {
131+
element: 'annotation',
132+
meta: {},
133+
attributes: {
134+
code: 123,
135+
},
136+
content: 'Missing argument description',
137+
};
138+
139+
annotation = (new Annotation()).fromRefract(refracted);
140+
});
141+
142+
it('should round-trip correctly', () => {
143+
expect(annotation.toRefract()).to.deep.equal(refracted);
101144
});
102145

103146
it('should have element name annotation', () => {
@@ -122,9 +165,12 @@ describe('Parse result namespace', () => {
122165
let sourceMap;
123166

124167
beforeEach(() => {
125-
sourceMap = (new SourceMap()).fromCompactRefract([
126-
'sourceMap', {}, {}, [],
127-
]);
168+
sourceMap = (new SourceMap()).fromRefract({
169+
element: 'sourceMap',
170+
meta: {},
171+
attributes: {},
172+
content: [],
173+
});
128174
});
129175

130176
it('should have element name sourceMap', () => {
@@ -135,18 +181,33 @@ describe('Parse result namespace', () => {
135181
context('source maps', () => {
136182
let element;
137183
let sourceMaps;
184+
let refracted;
138185

139186
beforeEach(() => {
140-
element = (new StringElement()).fromCompactRefract([
141-
'string', {}, {
187+
refracted = {
188+
element: 'string',
189+
meta: {},
190+
attributes: {
142191
sourceMap: [
143-
['sourceMap', {}, {}, [[1, 2]]],
192+
{
193+
element: 'sourceMap',
194+
meta: {},
195+
attributes: {},
196+
content: [[1, 2]],
197+
},
144198
],
145-
}, [],
146-
]);
199+
},
200+
content: [],
201+
};
202+
203+
element = (new StringElement()).fromRefract(refracted);
147204
sourceMaps = element.attributes.get('sourceMap');
148205
});
149206

207+
it('should round-trip correctly', () => {
208+
expect(element.toRefract()).to.deep.equal(refracted);
209+
});
210+
150211
it('should contain a sourceMap attribute with one item', () => {
151212
expect(sourceMaps).to.exist;
152213
expect(sourceMaps).to.have.length(1);
@@ -166,9 +227,7 @@ describe('Parse result namespace', () => {
166227
element: 'sourceMap',
167228
meta: {},
168229
attributes: {},
169-
content: [
170-
[1, 2],
171-
],
230+
content: [[1, 2]],
172231
},
173232
],
174233
},

0 commit comments

Comments
 (0)