Open alexmasselot opened 11 years ago
solved in fork https://github.com/alexmasselot/dataset
Ah, nice! Mind submitting a pull req?
done. That hardest part was to discover how github works for contributions (OK, I'm ashamed of discovering that only now....)
Hi trying to remove multiple lines fail with version 0.4.1 Her is the fix, line 1243 of miso.ds.0.4.1.m.js
.each(rowsToRemove, function(rowId) { is rewritten .each(rowsToRemove.reverse(), function(rowId) { That's a classic one, nope?
Want a jasmine test?? see below, the two last tests are failing by removing the wrong line...
Thanks a lot for for the Miso works ;)
define(['underscore', 'Miso'], function(, Miso) { describe('Miso.Dataset', function() { //just make a array of element with incremental id fireld and one char at a time var buildDummy = function(chars) { return .map(chars.split(''), function(c, i) { return { idx : i, val : c } }) } // load a dummy dataset and exeut the callback test when fetched var checkWithDummyDS = function(testName, chars, testCallback) { it(testName, function() { var ds = new Miso.Dataset({ data : buildDummy(chars) }); var ok; ds.fetch({ success : function() { ok = true }, error : function(err) { throw err } }) waitsFor(function() { return ok }) runs(function() { testCallback(ds) }) }) } it('builDummy', function() { expect(buildDummy('acc')).toEqual([{ idx : 0, val : 'a' }, { idx : 1, val : 'c' }, { idx : 2, val : 'c' }]);
})