<commit_before>var apn = require("../");
var sinon = require("sinon");

describe("Notification", function() {

	var note;
	beforeEach(function() {
		note = new apn.Notification();
	});

	describe("aps payload", function() {
		describe("alert property", function() {
			it("can be set to a string", function() {
				note.alert = "hello";
				expect(note.alert).to.equal("hello");
			});

			it("can be set to an object", function() {
				note.alert = {"body": "hello"};
				expect(note.alert).to.eql({"body": "hello"});
			});

			it("can be set to undefined", function() {
				note.alert = {"body": "hello"};
				note.alert = undefined;
				expect(note.alert).to.be.undefined;
			});

			it("cannot be set to a number", function() {
				note.alert = 5;
				expect(note.alert).to.be.undefined;
			});

			describe("getAlertText", function() {
				describe("plain alert string", function() {
					it("gets the alert text", function() {
						note.alert = "hello";

						expect(note.getAlertText()).to.equal("hello");
					});
				});

				describe("alert object", function() {<commit_msg>this is an important check<commit_after>var apn = require("../");
var sinon = require("sinon");

describe("Notification", function() {

	var note;
	beforeEach(function() {
		note = new apn.Notification();
	});

	describe("aps payload", function() {
		describe("alert property", function() {
			it("defaults to undefined", function() {
				expect(note.alert).to.be.undefined;
			});

			it("can be set to a string", function() {
				note.alert = "hello";
				expect(note.alert).to.equal("hello");
			});

			it("can be set to an object", function() {
				note.alert = {"body": "hello"};
				expect(note.alert).to.eql({"body": "hello"});
			});

			it("can be set to undefined", function() {
				note.alert = {"body": "hello"};
				note.alert = undefined;
				expect(note.alert).to.be.undefined;
			});

			it("cannot be set to a number", function() {
				note.alert = 5;
				expect(note.alert).to.be.undefined;
			});

			describe("getAlertText", function() {
				describe("plain alert string", function() {
					it("gets the alert text", function() {
						note.alert = "hello";

						expect(note.getAlertText()).to.equal("hello");
					});
				});

				describe("alert object", function() {
{'fraction_non_alphanumeric': 0.1943835015357613, 'fraction_numerical': 0.0008775778850372971, 'mean_word_length': 3.342857142857143, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '313061', 'n_tokens_mistral': 893, 'n_tokens_neox': 700, 'n_words': 171}