Comparing version 2.5.1 to 2.6.0
@@ -39,2 +39,6 @@ 'use strict'; | ||
var _tumblr = require('./tumblr'); | ||
var tumblr = _interopRequireWildcard(_tumblr); | ||
var _custom = require('./custom'); | ||
@@ -57,3 +61,3 @@ | ||
var types = { | ||
image: image, video: video, youtube: youtube, twitter: twitter, instagram: instagram, facebook: facebook, vine: vine, spotify: spotify, | ||
image: image, video: video, youtube: youtube, twitter: twitter, instagram: instagram, facebook: facebook, vine: vine, spotify: spotify, tumblr: tumblr, | ||
custom: custom /* last element */ | ||
@@ -60,0 +64,0 @@ }; |
@@ -9,2 +9,3 @@ import * as image from './image'; | ||
import * as spotify from './spotify'; | ||
import * as tumblr from './tumblr'; | ||
import * as custom from './custom'; | ||
@@ -15,3 +16,3 @@ import assert from 'assert'; | ||
const types = { | ||
image, video, youtube, twitter, instagram, facebook, vine, spotify, | ||
image, video, youtube, twitter, instagram, facebook, vine, spotify, tumblr, | ||
custom /* last element */ | ||
@@ -18,0 +19,0 @@ }; |
{ | ||
"name": "embeds", | ||
"version": "2.5.1", | ||
"version": "2.6.0", | ||
"description": "Parse & render embeds", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -12,3 +12,4 @@ const fs = require('fs'); | ||
tweetNoUser: fs.readFileSync(`${__dirname}/tweet-no-user.html`, 'utf8').trim(), | ||
tweetVideo: fs.readFileSync(`${__dirname}/tweet-video.html`, 'utf8').trim() | ||
tweetVideo: fs.readFileSync(`${__dirname}/tweet-video.html`, 'utf8').trim(), | ||
tumblrPost: fs.readFileSync(`${__dirname}/tumblr-post.html`, 'utf8').trim() | ||
}; |
@@ -536,2 +536,17 @@ import test from './tape-wrapper'; | ||
test('parse() tumblr embed', t => { | ||
const input = fixtures.tumblrPost; | ||
const actual = parse(input); | ||
const expected = { | ||
type: 'tumblr', | ||
did: '7c08ba46cb75162284770cdee2a59365891a5e18', | ||
url: 'https://embed.tumblr.com/embed/post/8_SX4ALNOf1fYyEcjq78YQ/147291233392', | ||
text: [{ | ||
content: 'http://jencita.tumblr.com/post/147291233392/tswiftdaily-taylor-swift-at-lady-cilento', | ||
href: 'http://jencita.tumblr.com/post/147291233392/tswiftdaily-taylor-swift-at-lady-cilento' | ||
}] | ||
}; | ||
t.deepEqual(actual, expected); | ||
}); | ||
test('parse() custom embed', t => { | ||
@@ -538,0 +553,0 @@ const input = '<iframe src="http://custom.com" width="600" height="600" frameborder="0"></iframe>'; |
@@ -53,1 +53,8 @@ import test from './tape-wrapper'; | ||
}); | ||
test('parse() + render() tumblr post', t => { | ||
const input = fixtures.tumblrPost; | ||
const expected = input; | ||
const actual = parseAndRender(input); | ||
t.is(actual, expected); | ||
}); |
@@ -334,2 +334,17 @@ import test from './tape-wrapper'; | ||
test('render() tumblr', t => { | ||
const input = { | ||
type: 'tumblr', | ||
did: '7c08ba46cb75162284770cdee2a59365891a5e18', | ||
url: 'https://embed.tumblr.com/embed/post/8_SX4ALNOf1fYyEcjq78YQ/147291233392', | ||
text: [{ | ||
content: 'http://jencita.tumblr.com/post/147291233392/tswiftdaily-taylor-swift-at-lady-cilento', | ||
href: 'http://jencita.tumblr.com/post/147291233392/tswiftdaily-taylor-swift-at-lady-cilento' | ||
}] | ||
}; | ||
const actual = render(input); | ||
const expected = fixtures.tumblrPost; | ||
t.is(actual, expected); | ||
}); | ||
test('renderText()', t => { | ||
@@ -336,0 +351,0 @@ t.deepEqual(renderText(undefined), []); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
124992
63
3046