UNPKG

1.13 kBJavaScriptView Raw
1var mocha = require('mocha');
2var assert = require('assert');
3var nconf = require('nconf');
4var testingKeys = nconf.env().file({
5 file: __dirname + '/testing_keys.json'
6});
7var util = require('util');
8var merge = require('merge');
9
10var postmark = require('../lib/postmark/index.js');
11
12describe('client bounce operations', function() {
13 this.timeout(30000);
14 var _client = null;
15
16 beforeEach(function() {
17 _client = new postmark.Client(testingKeys.get('WRITE_TEST_SERVER_TOKEN'));
18 });
19
20 it('can get get bounce', function(done) {
21 _client.getBounces({
22 count: 1
23 }, function(err, bounces) {
24 _client.getBounce(bounces.Bounces[0].ID, done);
25 });
26 });
27
28 it('can get bounces', function(done) {
29 _client.getBounces({
30 count: 10
31 }, done);
32 });
33
34 it('can get bounce dump', function(done) {
35 _client.getBounces({
36 count: 1
37 }, function(err, bounces) {
38 _client.getBounceDump(bounces.Bounces[0].ID, done);
39 });
40 });
41
42 it('can get bounce tags', function(done) {
43 _client.getBounceTags(done);
44 });
45
46 // activateBounce cannot be directly tested from integration tests.
47});
\No newline at end of file