summaryrefslogtreecommitdiffstats
path: root/lib/models/__tests__
diff options
context:
space:
mode:
Diffstat (limited to 'lib/models/__tests__')
-rw-r--r--lib/models/__tests__/config.js5
-rw-r--r--lib/models/__tests__/glossary.js10
-rw-r--r--lib/models/__tests__/glossaryEntry.js4
-rw-r--r--lib/models/__tests__/pluginDependency.js19
-rw-r--r--lib/models/__tests__/summary.js2
-rw-r--r--lib/models/__tests__/templateBlock.js14
6 files changed, 31 insertions, 23 deletions
diff --git a/lib/models/__tests__/config.js b/lib/models/__tests__/config.js
index 8445cef..ff04ffd 100644
--- a/lib/models/__tests__/config.js
+++ b/lib/models/__tests__/config.js
@@ -1,10 +1,7 @@
-jest.autoMockOff();
-
var Immutable = require('immutable');
+var Config = require('../config');
describe('Config', function() {
- var Config = require('../config');
-
var config = Config.createWithValues({
hello: {
world: 1,
diff --git a/lib/models/__tests__/glossary.js b/lib/models/__tests__/glossary.js
index 2ce224c..5bf64dc 100644
--- a/lib/models/__tests__/glossary.js
+++ b/lib/models/__tests__/glossary.js
@@ -1,10 +1,8 @@
-jest.autoMockOff();
+var File = require('../file');
+var Glossary = require('../glossary');
+var GlossaryEntry = require('../glossaryEntry');
describe('Glossary', function() {
- var File = require('../file');
- var Glossary = require('../glossary');
- var GlossaryEntry = require('../glossaryEntry');
-
var glossary = Glossary.createFromEntries(File(), [
{
name: 'Hello World',
@@ -30,7 +28,7 @@ describe('Glossary', function() {
});
describe('toText', function() {
- pit('return as markdown', function() {
+ it('return as markdown', function() {
return glossary.toText('.md')
.then(function(text) {
expect(text).toContain('# Glossary');
diff --git a/lib/models/__tests__/glossaryEntry.js b/lib/models/__tests__/glossaryEntry.js
index 9eabc68..833115d 100644
--- a/lib/models/__tests__/glossaryEntry.js
+++ b/lib/models/__tests__/glossaryEntry.js
@@ -1,8 +1,6 @@
-jest.autoMockOff();
+var GlossaryEntry = require('../glossaryEntry');
describe('GlossaryEntry', function() {
- var GlossaryEntry = require('../glossaryEntry');
-
describe('getID', function() {
it('must return a normalized ID', function() {
var entry = new GlossaryEntry({
diff --git a/lib/models/__tests__/pluginDependency.js b/lib/models/__tests__/pluginDependency.js
index 8aa55fb..0b105e9 100644
--- a/lib/models/__tests__/pluginDependency.js
+++ b/lib/models/__tests__/pluginDependency.js
@@ -1,6 +1,7 @@
-describe('PluginDependency', function() {
- var PluginDependency = require('../pluginDependency');
+var Immutable = require('immutable');
+var PluginDependency = require('../pluginDependency');
+describe('PluginDependency', function() {
describe('createFromString', function() {
it('must parse name', function() {
var plugin = PluginDependency.createFromString('hello');
@@ -42,6 +43,20 @@ describe('PluginDependency', function() {
});
});
});
+
+ describe('listToArray', function() {
+ var list = PluginDependency.listToArray(Immutable.List([
+ PluginDependency.createFromString('hello@1.0.0'),
+ PluginDependency.createFromString('noversion'),
+ PluginDependency.createFromString('-disabled')
+ ]));
+
+ expect(list).toEqual([
+ 'hello@1.0.0',
+ 'noversion',
+ '-disabled'
+ ]);
+ });
});
diff --git a/lib/models/__tests__/summary.js b/lib/models/__tests__/summary.js
index f73e49b..29c9330 100644
--- a/lib/models/__tests__/summary.js
+++ b/lib/models/__tests__/summary.js
@@ -82,7 +82,7 @@ describe('Summary', function() {
});
describe('toText', function() {
- pit('return as markdown', function() {
+ it('return as markdown', function() {
return summary.toText('.md')
.then(function(text) {
expect(text).toContain('# Summary');
diff --git a/lib/models/__tests__/templateBlock.js b/lib/models/__tests__/templateBlock.js
index fdd0210..e5f7666 100644
--- a/lib/models/__tests__/templateBlock.js
+++ b/lib/models/__tests__/templateBlock.js
@@ -6,7 +6,7 @@ describe('TemplateBlock', function() {
var TemplateBlock = require('../templateBlock');
describe('create', function() {
- pit('must initialize a simple TemplateBlock from a function', function() {
+ it('must initialize a simple TemplateBlock from a function', function() {
var templateBlock = TemplateBlock.create('sayhello', function(block) {
return {
body: '<p>Hello, World!</p>',
@@ -41,7 +41,7 @@ describe('TemplateBlock', function() {
};
});
- expect(templateBlock.getShortcuts()).not.toBeDefined();
+ expect(templateBlock.getShortcuts()).toNotExist();
});
it('must return complete shortcut', function() {
@@ -67,7 +67,7 @@ describe('TemplateBlock', function() {
});
describe('toNunjucksExt()', function() {
- pit('should replace by block anchor', function() {
+ it('should replace by block anchor', function() {
var templateBlock = TemplateBlock.create('sayhello', function(block) {
return 'Hello';
});
@@ -97,7 +97,7 @@ describe('TemplateBlock', function() {
});
});
- pit('must create a valid nunjucks extension', function() {
+ it('must create a valid nunjucks extension', function() {
var templateBlock = TemplateBlock.create('sayhello', function(block) {
return {
body: '<p>Hello, World!</p>',
@@ -120,7 +120,7 @@ describe('TemplateBlock', function() {
});
});
- pit('must apply block arguments correctly', function() {
+ it('must apply block arguments correctly', function() {
var templateBlock = TemplateBlock.create('sayhello', function(block) {
return {
body: '<'+block.kwargs.tag+'>Hello, '+block.kwargs.name+'!</'+block.kwargs.tag+'>',
@@ -143,7 +143,7 @@ describe('TemplateBlock', function() {
});
});
- pit('must accept an async function', function() {
+ it('must accept an async function', function() {
var templateBlock = TemplateBlock.create('sayhello', function(block) {
return Promise()
.then(function() {
@@ -169,7 +169,7 @@ describe('TemplateBlock', function() {
});
});
- pit('must handle nested blocks', function() {
+ it('must handle nested blocks', function() {
var templateBlock = new TemplateBlock({
name: 'yoda',
blocks: Immutable.List(['start', 'end']),