|
1 | | -import {expect} from 'chai'; |
2 | | -import dwGen from '../src'; |
| 1 | +'use strict'; |
3 | 2 |
|
4 | | -describe('wordlist', function() { |
5 | | - it('should return a string by default', function() { |
| 3 | +const expect = require('chai').expect; |
| 4 | +const dwGen = require('../src'); |
| 5 | + |
| 6 | +describe('wordlist', () => { |
| 7 | + it('should return a string by default', () => { |
6 | 8 | expect(dwGen()).to.be.a('string'); |
7 | 9 | }); |
8 | 10 |
|
9 | | - it('should return 6 words by default', function() { |
| 11 | + it('should return 6 words by default', () => { |
10 | 12 | expect(dwGen().split(' ').length).to.equal(6); |
11 | 13 | }); |
12 | 14 |
|
13 | | - it('should return an array if requested', function() { |
| 15 | + it('should return an array if requested', () => { |
14 | 16 | expect(dwGen({'format': 'array'})).to.be.a('array'); |
15 | 17 | }); |
16 | 18 |
|
17 | | - it('should return an 6 item array in array mode by default', function() { |
| 19 | + it('should return an 6 item array in array mode by default', () => { |
18 | 20 | expect(dwGen({'format': 'array'}).length).to.equal(6); |
19 | 21 | }); |
20 | 22 |
|
21 | | - it('should obey requested length in string mode', function() { |
| 23 | + it('should obey requested length in string mode', () => { |
22 | 24 | expect(dwGen({'wordcount': 11}).split(' ').length).to.equal(11); |
23 | 25 | }); |
24 | 26 |
|
25 | | - it('should obey requested length in array mode', function() { |
| 27 | + it('should obey requested length in array mode', () => { |
26 | 28 | expect(dwGen({'format': 'array', 'wordcount': 11}).length).to.equal(11); |
27 | 29 | }); |
28 | 30 |
|
29 | | - it('should support en', function() { |
30 | | - expect(function() { |
| 31 | + it('should support en', () => { |
| 32 | + expect(() => { |
31 | 33 | dwGen({'language': 'en'}); |
32 | 34 | }).to.not.throw(Error); |
33 | 35 | }); |
34 | 36 |
|
35 | | - it('should support jp', function() { |
36 | | - expect(function() { |
| 37 | + it('should support jp', () => { |
| 38 | + expect(() => { |
37 | 39 | dwGen({'language': 'jp'}); |
38 | 40 | }).to.not.throw(Error); |
39 | 41 | }); |
40 | 42 |
|
41 | | - it('should support swe', function() { |
42 | | - expect(function() { |
| 43 | + it('should support swe', () => { |
| 44 | + expect(() => { |
43 | 45 | dwGen({'language': 'swe'}); |
44 | 46 | }).to.not.throw(Error); |
45 | 47 | }); |
46 | 48 |
|
47 | | - it('should support sp', function() { |
48 | | - expect(function() { |
| 49 | + it('should support sp', () => { |
| 50 | + expect(() => { |
49 | 51 | dwGen({'language': 'sp'}); |
50 | 52 | }).to.not.throw(Error); |
51 | 53 | }); |
52 | 54 |
|
53 | | - it('should throw an error if asked for an unsupported language', function() { |
54 | | - expect(function() { |
| 55 | + it('should throw an error if asked for an unsupported language', () => { |
| 56 | + expect(() => { |
55 | 57 | dwGen({'language': 'bogusTalk'}); |
56 | 58 | }).to.throw(Error); |
57 | 59 | }); |
|
0 commit comments