How to use salinity - 10 common examples

To help you get started, we’ve selected a few salinity examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tidepool-org / uploader / test / lib / abbot / testFreeStyleLibreData.js View on Github external
recordNumbers.forEach(recordNumber => {
        // use lower 16bits to replace 16bit record number in historical record
        data.aapPackets[1].data.writeUInt16LE(recordNumber & 0xffff, RECORD_HEADER_OFFSET);

        // update CRC16 to be valid again
        const crc16 = FreeStyleLibreData.calcCrc16(
          data.aapPackets[1].data.slice(RECORD_HEADER_OFFSET, HISTORICAL_RECORD_CRC_OFFSET));
        data.aapPackets[1].data.writeUInt16LE(crc16, HISTORICAL_RECORD_CRC_OFFSET);

        // use recordNumber + 1 as current DB record number (which will be used for next record written)
        const postRecords = fsLibreData.processAapPackets(data.aapPackets, recordNumber + 1);

        // check if valid record was returned and contains correct 32bit record number
        expect(postRecords.length).equals(1);
        expect(postRecords[0].index).equals(recordNumber);
      });
    });
github tidepool-org / uploader / test / lib / abbot / testFreeStyleLibreData.js View on Github external
};

      // read record number from packet
      let recordNumber = data.aapPackets[1].data.readUInt16LE(RECORD_HEADER_OFFSET);

      // flip one bit in the record number
      recordNumber ^= 0x0100;

      // write record number back into packet
      data.aapPackets[1].data.writeUInt16LE(recordNumber, RECORD_HEADER_OFFSET);

      // use recordNumber + 1 as current DB record number (which will be used for next record written)
      const postRecords = fsLibreData.processAapPackets(data.aapPackets, recordNumber + 1);

      // check that no valid record was returned
      expect(postRecords.length).equals(0);
    });
github tidepool-org / uploader / test / lib / testStruct.js View on Github external
it('works for B', function(){
      var buf = new Uint8Array(4);
      var inputBuf = [1, 2, 3, 4];
      var len = theStruct.pack(buf, 0, '4B', inputBuf);
      expect(len).to.equal(4);
      var result = String.fromCharCode.apply(null, buf);
      var expected = String.fromCharCode.apply(null, inputBuf);
      expect(result).to.equal(expected);
    });
    it('works for z', function(){
github tidepool-org / uploader / test / ui / testAppActions.js View on Github external
it('sets the boolean for the dropdown menu to false, always', function() {
      app.state.dropMenu = true;
      appActions.hideDropMenu();
      expect(app.state.dropMenu).to.be.false;
      appActions.hideDropMenu();
      expect(app.state.dropMenu).to.be.false;
    });
github tidepool-org / uploader / test / lib / testStruct.js View on Github external
it('works for b', function(){
      var buf = new Uint8Array(5);
      var len = theStruct.pack(buf, 0, '5b', 0x48, 0x65, 0x6c, 0x6c, 0x6f);
      expect(len).to.equal(5);
      var s = String.fromCharCode.apply(null, buf);
      expect(s).to.equal('Hello');
    });
    it('works for s', function(){
github tidepool-org / uploader / test / ui / testAppActions.js View on Github external
it('redirects to settings page and clears dropMenu', function() {
      appActions.chooseDevices();
      expect(app.state.dropMenu).to.be.false;
      expect(app.state.page).to.equal('settings');
    });
  });
github tidepool-org / uploader / test / lib / testStruct.js View on Github external
it('works for b', function(){
      var buf = new Uint8Array(5);
      var len = theStruct.pack(buf, 0, '5b', 0x48, 0x65, 0x6c, 0x6c, 0x6f);
      expect(len).to.equal(5);
      var s = String.fromCharCode.apply(null, buf);
      expect(s).to.equal('Hello');
    });
    it('works for s', function(){
github tidepool-org / uploader / test / ui / testAppActions.js View on Github external
it('updates user id for uploading', function() {
      app.state.targetId = 'foo';
      appActions.changeGroup('bar');
      expect(app.state.targetId).to.equal('bar');
    });
github tidepool-org / uploader / test / lib / dexcom / testUserSettingsChanges.js View on Github external
it('returns an object with `timeChanges` and `settingsChange` attributes', function() {
    var res = userSettingsChanges([]);
    expect(typeof res).to.equal('object');
    expect(res.timeChanges).to.exist;
    expect(res.settingChanges).to.exist;
  });
github tidepool-org / uploader / test / lib / insulet / testLogic.js View on Github external
it('should be a function', function() {
      expect(logic.calculateNetRecommendation).to.exist;
      expect(typeof logic.calculateNetRecommendation).to.equal('function');
    });

salinity

Test library from tidepool.org

BSD-2-Clause
Latest version published 3 months ago

Package Health Score

65 / 100
Full package analysis

Popular salinity functions