Migrated unparse test suite to assert

refs https://github.com/TryGhost/Team/issues/1076

- The 'should' assertion library is deprecated. Native 'assert' is the recommended lib to use
- Migrating this bit of code allows to remove the should's "utils" folder. Less code, yey!
This commit is contained in:
Naz 2022-10-21 16:24:39 +08:00
parent 6c2d057e25
commit 0d1479158c
No known key found for this signature in database

View File

@ -1,4 +1,4 @@
const should = require('should');
const assert = require('assert');
const {unparse} = require('../index');
describe('unparse', function () {
@ -11,10 +11,10 @@ describe('unparse', function () {
const result = unparse(json);
should.exist(result);
assert.ok(result);
const expected = `id,email,name,note,subscribed_to_emails,complimentary_plan,stripe_customer_id,created_at,deleted_at,labels,products\r\n,email@example.com,Sam Memberino,Early supporter,,,,,,,`;
should.equal(result, expected);
const expected = `id,email,name,note,subscribed_to_emails,complimentary_plan,stripe_customer_id,created_at,deleted_at,labels,tiers\r\n,email@example.com,Sam Memberino,Early supporter,,,,,,,`;
assert.equal(result, expected);
});
it('maps the subscribed property to subscribed_to_emails', function () {
@ -31,6 +31,6 @@ describe('unparse', function () {
const expected = `email,subscribed_to_emails\r\ndo-not-email-me@email.com,false`;
should.equal(result, expected);
assert.equal(result, expected);
});
});