My package has a foo.html and a foo.coffee that has Template.foo.helpers ...
When I run the mocha package test:
meteor test-packages --driver-package velocity:console-reporter mypkg
I get:
W20151209-04:58:22.249(-5)? (STDERR) /Users/me/.meteor/packages/meteor-tool/.1.1.10.1gqrep8++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20151209-04:58:22.249(-5)? (STDERR) throw(ex);
W20151209-04:58:22.249(-5)? (STDERR) ^
W20151209-04:58:22.250(-5)? (STDERR) TypeError: Cannot call method 'helpers' of undefined
=> Exited with code: 8
package.js has:
Package.onUse(function(api) {
api.use('meteor-platform');
...
api.addFiles(['foo.html', 'foo.coffee'],'client');
api.addFiles(['bar.coffee'],'server');
})
Package.onTest(function(api) {
api.use('mike:mocha-package');
api.use('meteor-platform');
...
api.addFiles(['tests.coffee'],'server');
})
I've also tried .useing
api.use('meteor-base');
api.use('blaze-html-templates');
instead of meteor-platform.
Related
I'm new to meteor and playing with Telescope for past few days. Yesterday, I updated the Packages. From then on I'm not able to run the Telescope app in my Mac.
=> Started proxy.
=> Started MongoDB.
I20151128-19:27:24.429(8)? Kadira: completed instrumenting the app
W20151128-19:27:24.432(8)? (STDERR)
W20151128-19:27:24.432(8)? (STDERR) /Users/bala/.meteor/packages/meteor-tool/.1.1.10.jru118++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20151128-19:27:24.432(8)? (STDERR) throw(ex);
W20151128-19:27:24.433(8)? (STDERR) ^
W20151128-19:27:24.433(8)? (STDERR) Error: deny: Value for `update` must be a function
W20151128-19:27:24.433(8)? (STDERR) at packages/mongo/collection.js:755:1
W20151128-19:27:24.433(8)? (STDERR) at Array.forEach (packages/es5-shim/.npm/package/node_modules/es5-shim/es5-shim.js:417:1)
W20151128-19:27:24.433(8)? (STDERR) at Function._.each._.forEach (packages/underscore/underscore.js:105:1)
W20151128-19:27:24.433(8)? (STDERR) at [object Object].addValidator (packages/mongo/collection.js:752:1)
W20151128-19:27:24.433(8)? (STDERR) at [object Object].Mongo.Collection.deny (packages/mongo/collection.js:804:1)
W20151128-19:27:24.433(8)? (STDERR) at Posts.getNotificationProperties.properties.postAuthorName (lib/herald.js:7:21)
W20151128-19:27:24.433(8)? (STDERR) at /Users/bala/meteor/Telescope/.meteor/local/build/programs/server/boot.js:249:5
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.
Can anyone pls help me on this.
*Herald.js file is below
if (Meteor.absoluteUrl().indexOf('localhost') !== -1)
Herald.settings.queueTimer = 1000;
Meteor.startup(function () {
Herald.collection.deny({ update: !Users.can.editById, remove: !Users.can.editById });
// disable all email notifications when "emailNotifications" is set to false
Herald.settings.overrides.email = !Settings.get('emailNotifications', true); });
This is an issue with the recent Meteor 1.2 update. I would start by making sure you're using the latest version of all Telescope packages.
I have'd similar error with my meteor app, solved like this:
Close browser, exit terminal, reboot, open terminal, start app. It's something with browser.
Right now I have:
Package.describe({
name: 'parlay:synapsepay',
version: '0.0.1',
summary: 'synapse_pay_rest for Meteor',
git: 'https://github.com/parlaywithme/meteor-synapsepay',
documentation: 'README.md'
});
Package.onUse(function(api) {
api.versionsFrom('1.2.0.2');
api.use('coffeescript');
api.addFiles('synapsepay.coffee');
});
Package.onTest(function(api) {
api.use('coffeescript');
api.use('mike:mocha-package');
api.use('parlay:synapsepay');
api.addFiles('synapsepay-tests.coffee');
});
and
MochaWeb?.testOnly ->
describe 'sanity', ->
it 'is visible', ->
chai.assert.isDefined SynapsePay
https://github.com/parlaywithme/meteor-synapsepay
I'm getting a has no method 'testOnly' error, running
meteor test-packages ./
inside packages/meteor-synapsepay:
ERROR: packages.json parsing error [ ENOENT, no such file or directory '/Users/me/parlay/packages/meteor-synapsepay/packages.json' ]
[[[[[ Tests ]]]]]
=> Started proxy.
=> Started MongoDB.
W20151018-00:24:58.123(-4)? (STDERR)
W20151018-00:24:58.125(-4)? (STDERR) /Users/me/.meteor/packages/meteor-tool/.1.1.9.osr2yb++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20151018-00:24:58.125(-4)? (STDERR) throw(ex);
W20151018-00:24:58.125(-4)? (STDERR) ^
W20151018-00:24:58.125(-4)? (STDERR) TypeError: Object [object Object] has no method 'testOnly'
W20151018-00:24:58.125(-4)? (STDERR) at Package (packages/local-test_parlay_synapsepay/synapsepay-tests.coffee:1:11)
W20151018-00:24:58.125(-4)? (STDERR) at packages/local-test_parlay_synapsepay/synapsepay-tests.coffee:1:1
W20151018-00:24:58.126(-4)? (STDERR) at packages/local-test_parlay_synapsepay/synapsepay-tests.coffee:1:1
W20151018-00:24:58.126(-4)? (STDERR) at /private/tmp/meteor-test-run1tbmejw/.meteor/local/build/programs/server/boot.js:242:10
W20151018-00:24:58.126(-4)? (STDERR) at Array.forEach (native)
W20151018-00:24:58.126(-4)? (STDERR) at Function._.each._.forEach (/Users/me/.meteor/packages/meteor-tool/.1.1.9.osr2yb++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20151018-00:24:58.126(-4)? (STDERR) at /private/tmp/meteor-test-run1tbmejw/.meteor/local/build/programs/server/boot.js:137:5
=> Exited with code: 8
While poorly documented at the moment, this issue can be solved easily:
Simply ditch testOnly and write your tests directly in your test file.
describe 'sanity', ->
it 'is visible', ->
chai.assert.isDefined SynapsePay
Mocha was first designed for application tests. Using it for package tests can prove challenging.
When you will have your tests running, you may also see big Meteor.methods Match errors in the console. It is a common issue that should not interfere with the tests themselves.
I am new-bee to meteor, i am struggling to run this.
kanna#kanna-VPCEB3QFX:~/Desktop/testhtml5/testhtml5/testHTML$ sudo meteor
[sudo] password for kanna:`enter code here`
[[[[[ ~/Desktop/testrschtml5/rschtml5/testHTML ]]]]]
=> Started proxy.
=> Started MongoDB.
W20141017-13:19:19.659(5.5)? (STDERR)
W20141017-13:19:19.737(5.5)? (STDERR) /home/kanna/.meteor/packages/meteor-tool/.1.0.34.1atmdl8++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
W20141017-13:19:19.738(5.5)? (STDERR) throw(ex);
W20141017-13:19:19.739(5.5)? (STDERR) ^
W20141017-13:19:19.739(5.5)? (STDERR) TypeError: Cannot call method 'add' of undefined
W20141017-13:19:19.739(5.5)? (STDERR) at app/server/route.js:8:15
W20141017-13:19:19.740(5.5)? (STDERR) at app/server/route.js:930:3
W20141017-13:19:19.740(5.5)? (STDERR) at /home/kanna/Desktop/testhtml5/testhtml5/testHTML/.meteor/local/build/programs/server/boot.js:168:10
W20141017-13:19:19.740(5.5)? (STDERR) at Array.forEach (native)
W20141017-13:19:19.741(5.5)? (STDERR) at Function..each..forEach (/home/kanna/.meteor/packages/meteor-tool/.1.0.34.1atmdl8++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
W20141017-13:19:19.741(5.5)? (STDERR) at /home/kanna/Desktop/rschtml5/rschtml5/testhtml5/.meteor/local/build/programs/server/boot.js:82:5
=> Exited with code: 8
The code for route.js is
Meteor.Router.add({
'/output/login': function () {
/some thing here
}
After deciding to create a new project and start fresh and then checkout the code for a separate project (that was in a working state) I'm getting the following error with simple-schema. This schema was working so its likely that an update has broken it in some respect.
Can anyone suggest what I need to do to sort this?
Terminal output:
$ meteor
[[[[[ ~/puzzle ]]]]]
=> Started proxy.
=> Started MongoDB.
W20140906-10:30:37.252(-7)? (STDERR)
W20140906-10:30:37.339(-7)? (STDERR) /home/me/.meteor/packages/meteor-tool/.1.0.27.11fuo6h++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:173
W20140906-10:30:37.339(-7)? (STDERR) throw(ex);
W20140906-10:30:37.340(-7)? (STDERR) ^
W20140906-10:30:37.340(-7)? (STDERR) ReferenceError: SimpleSchema is not defined
W20140906-10:30:37.341(-7)? (STDERR) at app/lib/schema-Account-Type.js:5:26
W20140906-10:30:37.341(-7)? (STDERR) at app/lib/schema-Account-Type.js:25:3
W20140906-10:30:37.341(-7)? (STDERR) at /home/me/puzzle/.meteor/local/build/programs/server/boot.js:161:10
W20140906-10:30:37.342(-7)? (STDERR) at Array.forEach (native)
W20140906-10:30:37.342(-7)? (STDERR) at Function._.each._.forEach (/home/graeme/.meteor/packages/meteor-tool/.1.0.27.11fuo6h++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
W20140906-10:30:37.342(-7)? (STDERR) at /home/me/puzzle/.meteor/local/build/programs/server/boot.js:82:5
=> Exited with code: 8
Schema:
AccountType = new Meteor.Collection("AccountType");
Schema = {};
Schema.AccountType = new SimpleSchema({
accountType: {
type: String,
allowedValues: ['test', 'live']
},
createdBy: {
type: String,
autoValue: function(){ return this.userId }
}
});
SimpleSchema.debug = true;
AccountType.attachSchema(Schema.AccountType);
I had the same issue. Resolved by the following steps - installing SimpleSchema:
Try installing / reinstalling: aldeed:simple-schema.
Looking at how to install packages: https://guide.meteor.com/using-npm-packages.html
So, I found https://atmospherejs.com/aldeed/simple-schema on Atmosphere to get the correct install script:
meteor add aldeed:simple-schema
(Reference)
Fixed it, ended up having to create a new Meteor app though.
https://github.com/aldeed/meteor-simple-schema/issues/147
Getting Exception Mongo is not defined inside my custom Package
CODE
ABC = new Mongo.Collection('ABC');
ERROR
W20140905-17:49:06.809(5.5)? (STDERR) /home/sandeep/.meteor/packages/meteor-tool/.1.0.27.18sl1cs++os.linux.x86_32+web.browser+web.cordova/meteor-tool-os.linux.x86_32/dev_bundle/lib/node_modules/fibers/future.js:173
W20140905-17:49:06.809(5.5)? (STDERR) throw(ex);
W20140905-17:49:06.810(5.5)? (STDERR) ^
W20140905-17:49:06.810(5.5)? (STDERR) ReferenceError: Mongo is not defined
You need to list all the packages you use in your package.js file:
Package.onUse(function (api) {
api.use('mongo', ['client', 'server']);
...
});
Also check that you have space on your HD, That was my problem.