From 3a2ccea3a96661d997764b7b9371c70eb4f7ab49 Mon Sep 17 00:00:00 2001 From: Hannah Wolfe Date: Fri, 10 Apr 2020 08:19:16 +0100 Subject: [PATCH] Moved helper util tests to Ghost-SDK/helpers ref 99b2adc1c82eface95dca2a85d6f62169265d3e4 - these tests belong to @tryghost/helpers as they test code that isn't in this repo --- test/unit/helpers/utils_spec.js | 50 --------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 test/unit/helpers/utils_spec.js diff --git a/test/unit/helpers/utils_spec.js b/test/unit/helpers/utils_spec.js deleted file mode 100644 index 81a61c2746..0000000000 --- a/test/unit/helpers/utils_spec.js +++ /dev/null @@ -1,50 +0,0 @@ -const should = require('should'); -const helperUtils = require('@tryghost/helpers').utils; - -describe('Helpers Utils', function () { - describe('Word Count', function () { - it('[success] can count words', function () { - var html = 'Some words here', - result = helperUtils.countWords(html); - - result.should.equal(3); - }); - - it('[success] sanitized HTML tags', function () { - var html = '

This is a text example! Count me in ;)

', - result = helperUtils.countWords(html); - - result.should.equal(8); - }); - - it('[success] sanitized non alpha-numeric characters', function () { - var html = '

This is a text example! I love Döner. Especially number 875.

', - result = helperUtils.countWords(html); - - result.should.equal(11); - }); - - it('[success] counted Chinese characters', function () { - var html = '

我今天在家吃了好多好多好吃的,现在的我非常开心非常满足

', - result = helperUtils.countWords(html); - - result.should.equal(26); - }); - - it('[success] sanitized white space correctly', function () { - var html = '

This is a text example!\n Count me in ;)

', - result = helperUtils.countWords(html); - - result.should.equal(8); - }); - }); - - describe('Image Count', function () { - it('[success] can count images', function () { - var html = '

This is a text example! Count me in ;)

', - result = helperUtils.countImages(html); - - result.should.equal(2); - }); - }); -});