<commit_before>var format = require('util').format,
  Promise = require('bluebird'),
  ZeroPush = require('nzero-push'),
  rollbar = require('rollbar');

module.exports = bookshelf.Model.extend({
  tableName: 'push_notifications',

  send: function(options) {

    var zeroPush = new ZeroPush(process.env.ZEROPUSH_PROD_TOKEN),
      notify = Promise.promisify(zeroPush.notify, zeroPush),
      platform = "ios_macos",
      deviceTokens = [this.get("device_token")],
      notification = {
        alert: this.get("alert"),
        info: JSON.parse(this.get("payload")),
        badge: this.get("badge_no")
      };

    this.set("time_sent", (new Date()).toISOString());<commit_msg>don't really send push notifications in test env<commit_after>var format = require('util').format,
  Promise = require('bluebird'),
  ZeroPush = require('nzero-push'),
  rollbar = require('rollbar');

module.exports = bookshelf.Model.extend({
  tableName: 'push_notifications',

  send: function(options) {

    if (process.env.NODE_ENV == 'test') return;

    var zeroPush = new ZeroPush(process.env.ZEROPUSH_PROD_TOKEN),
      notify = Promise.promisify(zeroPush.notify, zeroPush),
      platform = "ios_macos",
      deviceTokens = [this.get("device_token")],
      notification = {
        alert: this.get("alert"),
        info: JSON.parse(this.get("payload")),
        badge: this.get("badge_no")
      };

    this.set("time_sent", (new Date()).toISOString());
{'fraction_non_alphanumeric': 0.15862068965517243, 'fraction_numerical': 0.0, 'mean_word_length': 3.8366666666666664, 'pattern_counts': {'":': 0, '<': 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': '751736', 'n_tokens_mistral': 463, 'n_tokens_neox': 455, 'n_words': 82}