{"size": 1049, "ext": "js", "max_stars_repo_path": "spec/pushSpec.js", "max_stars_repo_name": "rongcloud/server-sdk-nodejs", "max_stars_repo_stars_event_min_datetime": "2015-04-02T06:45:23.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-10T08:53:26.000Z", "max_issues_repo_path": "spec/pushSpec.js", "max_issues_repo_name": "rongcloud/server-sdk-nodejs", "max_issues_repo_issues_event_min_datetime": "2015-06-03T07:00:40.000Z", "max_issues_repo_issues_event_max_datetime": "2020-02-29T11:14:30.000Z", "max_forks_repo_path": "spec/pushSpec.js", "max_forks_repo_name": "rongcloud/server-sdk-nodejs", "max_forks_repo_forks_event_min_datetime": "2015-04-02T02:51:02.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-25T07:07:59.000Z"}
{"max_stars_count": 83, "max_issues_count": 22, "max_forks_count": 49, "avg_line_length": 22.3191489362, "max_line_length": 52, "alphanum_fraction": 0.5996186845}
"use strict";
describe('Push', () => {
	let _golbal, Push;
	beforeAll(function() {
		_golbal = this;
		Push = _golbal.rongSDK.Push;
	});
	const config = require('../lib/push/api.json');

	describe('push', () => {
		let conf = config.push;
		let response = conf.response;
		let success = response.success.code;

		it('Success', () => {
			let pushContent = _golbal.pushContent;
			return Push.push(pushContent).then(result => {
				expect(result.code).toEqual(Number(success));
			});
		});

		it('Fail', () => {
			return Push.push({}).catch(error => {
				expect(error).not.toBeUndefined();
			});
		});
	});

	describe('message', () => {
		let conf = config.message;
		let response = conf.response;
		let success = response.success.code;

		it('Success', () => {
			let pushMessage = _golbal.pushMessage;
			return Push.message(pushMessage).then(result => {
				expect(result.code).toEqual(Number(success));
			});
		});

		it('Fail', () => {
			return Push.message({}).catch(error => {
				expect(error).not.toBeUndefined();
			});
		});
	});
});