Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
minified version
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoma committed Dec 20, 2016
1 parent 914c341 commit ec4a9d3
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 61 deletions.
17 changes: 14 additions & 3 deletions Gruntfile.js
@@ -1,6 +1,7 @@
module.exports = function(grunt) {

grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.initConfig({
connect: {
Expand All @@ -13,11 +14,21 @@ module.exports = function(grunt) {
options: {
port: 8081,
keepalive: true,
protocol: "https"
protocol: 'https'
}
}
},
uglify: {
options: {
mangle: false
},
my_target: {
files: {
'src/tabletop.min.js': ['src/tabletop.js']
}
}
}
});

grunt.registerTask("default", ["connect"]);
grunt.registerTask("default", ["uglify","connect"]);
}
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -21,6 +21,8 @@
"chai": "^3.5.0",
"grunt": "*",
"grunt-contrib-connect": "*",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-uglify": "^2.0.0",
"mocha": "^3.2.0"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions src/tabletop.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

127 changes: 69 additions & 58 deletions test/sheets.js
@@ -1,4 +1,5 @@
var Tabletop = require('../src/tabletop')
var TabletopMin = require('../src/tabletop.min')
var assert = require('assert');

var sheets = {
Expand All @@ -7,73 +8,83 @@ var sheets = {
'2016': 'https://docs.google.com/spreadsheets/d/1sbyMINQHPsJctjAtMW0lCfLrcpMqoGMOJj6AN-sNQrc/pubhtml'
}

describe('2011-ish era spreadsheets', function() {
it('pulls in a single spreadsheet', function(done) {
var tabletop = Tabletop.init({
key: sheets['2011'],
callback: function(data, tabletop) {
assert(data.length, 3, '3 rows were pulled in')
done()
},
simpleSheet: true
function testTabletop(Tabletop) {
describe('2011-ish era spreadsheets', function() {
it('pulls in a single spreadsheet', function(done) {
var tabletop = Tabletop.init({
key: sheets['2011'],
callback: function(data, tabletop) {
assert(data.length, 3, '3 rows were pulled in')
done()
},
simpleSheet: true
})
})
})

it('pulls in a multiple spreadsheets', function(done) {
var tabletop = Tabletop.init({
key: sheets['2011'],
callback: function(data, tabletop) {
assert(tabletop.sheets('Sheet1'), 'can access Sheet1')
done()
}
it('pulls in a multiple spreadsheets', function(done) {
var tabletop = Tabletop.init({
key: sheets['2011'],
callback: function(data, tabletop) {
assert(tabletop.sheets('Sheet1'), 'can access Sheet1')
done()
}
})
})
})
});
});

describe('2014-ish era spreadsheets', function() {
it('pulls in a single spreadsheet', function(done) {
var tabletop = Tabletop.init({
key: sheets['2014'],
callback: function(data, tabletop) {
assert(data.length, 2, '2 rows were pulled in')
done()
},
simpleSheet: true
describe('2014-ish era spreadsheets', function() {
it('pulls in a single spreadsheet', function(done) {
var tabletop = Tabletop.init({
key: sheets['2014'],
callback: function(data, tabletop) {
assert(data.length, 2, '2 rows were pulled in')
done()
},
simpleSheet: true
})
})
})

it('pulls in a multiple spreadsheets', function(done) {
var tabletop = Tabletop.init({
key: sheets['2014'],
callback: function(data, tabletop) {
assert(tabletop.sheets('Sheet1'), 'can access Sheet1')
done()
}
it('pulls in a multiple spreadsheets', function(done) {
var tabletop = Tabletop.init({
key: sheets['2014'],
callback: function(data, tabletop) {
assert(tabletop.sheets('Sheet1'), 'can access Sheet1')
done()
}
})
})
})
});
});


describe('2016-ish era spreadsheets', function() {
it('pulls in a single spreadsheet', function(done) {
var tabletop = Tabletop.init({
key: sheets['2016'],
callback: function(data, tabletop) {
assert(data.length, 4, '4 rows were pulled in')
done()
},
simpleSheet: true
describe('2016-ish era spreadsheets', function() {
it('pulls in a single spreadsheet', function(done) {
var tabletop = Tabletop.init({
key: sheets['2016'],
callback: function(data, tabletop) {
assert(data.length, 4, '4 rows were pulled in')
done()
},
simpleSheet: true
})
})
})

it('pulls in a multiple spreadsheets', function(done) {
var tabletop = Tabletop.init({
key: sheets['2016'],
callback: function(data, tabletop) {
assert(tabletop.sheets('books'), 'can access books')
done()
},
simpleSheet: true
it('pulls in a multiple spreadsheets', function(done) {
var tabletop = Tabletop.init({
key: sheets['2016'],
callback: function(data, tabletop) {
assert(tabletop.sheets('books'), 'can access books')
done()
},
simpleSheet: true
})
})
})
});
});
}

describe("Non-minified Tabletop", function() {
testTabletop(Tabletop)
})

describe("Minified Tabletop", function() {
testTabletop(TabletopMin)
})

0 comments on commit ec4a9d3

Please sign in to comment.