mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
more async-promise erorr testcases
This commit is contained in:
parent
dfba740024
commit
f6351f83ea
133
package.json
133
package.json
@ -1,67 +1,68 @@
|
||||
{
|
||||
"name": "marko",
|
||||
"description": "Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.",
|
||||
"keywords": [
|
||||
"templating",
|
||||
"template",
|
||||
"async",
|
||||
"streaming"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/raptorjs/marko.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node_modules/.bin/mocha --ui bdd --reporter spec ./test && node_modules/.bin/jshint compiler/ runtime/ taglibs/",
|
||||
"test-fast": "node_modules/.bin/mocha --ui bdd --reporter spec ./test/render-test",
|
||||
"test-async": "node_modules/.bin/mocha --ui bdd --reporter spec ./test/render-async-test",
|
||||
"test-taglib-loader": "node_modules/.bin/mocha --ui bdd --reporter spec ./test/taglib-loader-test",
|
||||
"jshint": "node_modules/.bin/jshint compiler/ runtime/ taglibs/"
|
||||
},
|
||||
"author": "Patrick Steele-Idem <pnidem@gmail.com>",
|
||||
"maintainers": [
|
||||
"Patrick Steele-Idem <pnidem@gmail.com>"
|
||||
],
|
||||
"dependencies": {
|
||||
"app-module-path": "^1.0.0",
|
||||
"async-writer": "^1.4.0",
|
||||
"browser-refresh-client": "^1.0.0",
|
||||
"char-props": "~0.1.5",
|
||||
"events": "^1.0.2",
|
||||
"htmlparser2": "^3.7.2",
|
||||
"jsonminify": "^0.2.3",
|
||||
"marko-async": "^2.0.0",
|
||||
"marko-layout": "^2.0.0",
|
||||
"minimatch": "^0.2.14",
|
||||
"property-handlers": "^1.0.0",
|
||||
"raptor-args": "^1.0.0",
|
||||
"raptor-json": "^1.0.1",
|
||||
"raptor-logging": "^1.0.1",
|
||||
"raptor-modules": "^1.0.5",
|
||||
"raptor-polyfill": "^1.0.0",
|
||||
"raptor-promises": "^1.0.1",
|
||||
"raptor-regexp": "^1.0.0",
|
||||
"raptor-strings": "^1.0.0",
|
||||
"raptor-util": "^1.0.0",
|
||||
"resolve-from": "^1.0.0",
|
||||
"sax": "^0.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "~1.8.1",
|
||||
"dustjs-linkedin": "^2.3.4",
|
||||
"jshint": "^2.5.0",
|
||||
"mocha": "~1.15.1",
|
||||
"raptor-cache": "^1.1.1",
|
||||
"raptor-data-providers": "^1.0.1-beta",
|
||||
"through": "^2.3.4"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"markoc": "bin/markoc"
|
||||
},
|
||||
"main": "runtime/marko-runtime.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"version": "2.7.3"
|
||||
}
|
||||
"name": "marko",
|
||||
"description": "Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.",
|
||||
"keywords": [
|
||||
"templating",
|
||||
"template",
|
||||
"async",
|
||||
"streaming"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/raptorjs/marko.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node_modules/.bin/mocha --ui bdd --reporter spec ./test && node_modules/.bin/jshint compiler/ runtime/ taglibs/",
|
||||
"test-fast": "node_modules/.bin/mocha --ui bdd --reporter spec ./test/render-test",
|
||||
"test-async": "node_modules/.bin/mocha --ui bdd --reporter spec ./test/render-async-test",
|
||||
"test-taglib-loader": "node_modules/.bin/mocha --ui bdd --reporter spec ./test/taglib-loader-test",
|
||||
"jshint": "node_modules/.bin/jshint compiler/ runtime/ taglibs/"
|
||||
},
|
||||
"author": "Patrick Steele-Idem <pnidem@gmail.com>",
|
||||
"maintainers": [
|
||||
"Patrick Steele-Idem <pnidem@gmail.com>"
|
||||
],
|
||||
"dependencies": {
|
||||
"app-module-path": "^1.0.0",
|
||||
"async-writer": "^1.4.0",
|
||||
"browser-refresh-client": "^1.0.0",
|
||||
"char-props": "~0.1.5",
|
||||
"events": "^1.0.2",
|
||||
"htmlparser2": "^3.7.2",
|
||||
"jsonminify": "^0.2.3",
|
||||
"marko-async": "^2.0.0",
|
||||
"marko-layout": "^2.0.0",
|
||||
"minimatch": "^0.2.14",
|
||||
"property-handlers": "^1.0.0",
|
||||
"raptor-args": "^1.0.0",
|
||||
"raptor-json": "^1.0.1",
|
||||
"raptor-logging": "^1.0.1",
|
||||
"raptor-modules": "^1.0.5",
|
||||
"raptor-polyfill": "^1.0.0",
|
||||
"raptor-promises": "^1.0.1",
|
||||
"raptor-regexp": "^1.0.0",
|
||||
"raptor-strings": "^1.0.0",
|
||||
"raptor-util": "^1.0.0",
|
||||
"resolve-from": "^1.0.0",
|
||||
"sax": "^0.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bluebird": "^2.9.30",
|
||||
"chai": "~1.8.1",
|
||||
"dustjs-linkedin": "^2.3.4",
|
||||
"jshint": "^2.5.0",
|
||||
"mocha": "~1.15.1",
|
||||
"raptor-cache": "^1.1.1",
|
||||
"raptor-data-providers": "^1.0.1-beta",
|
||||
"through": "^2.3.4"
|
||||
},
|
||||
"license": "Apache-2.0",
|
||||
"bin": {
|
||||
"markoc": "bin/markoc"
|
||||
},
|
||||
"main": "runtime/marko-runtime.js",
|
||||
"publishConfig": {
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"version": "2.7.3"
|
||||
}
|
||||
|
||||
@ -1 +0,0 @@
|
||||
1-An error has occurred!2-An error has occurred!
|
||||
@ -1,9 +0,0 @@
|
||||
<async-fragment data-provider="data.userInfo" var="user">
|
||||
<async-fragment-error>
|
||||
1-An error has occurred!
|
||||
</async-fragment-error>
|
||||
1
|
||||
</async-fragment>
|
||||
<async-fragment data-provider="data.userInfo" var="user" error-message="2-An error has occurred!">
|
||||
2
|
||||
</async-fragment>
|
||||
@ -1,20 +0,0 @@
|
||||
exports.tests = [
|
||||
{
|
||||
templateData: {
|
||||
userInfo: function(done) {
|
||||
done(new Error('Invalid user'));
|
||||
}
|
||||
},
|
||||
expectedFile: require.resolve('./expected.html')
|
||||
},
|
||||
{
|
||||
templateData: {
|
||||
userInfo: function(done) {
|
||||
setTimeout(function() {
|
||||
done(new Error('Invalid user'));
|
||||
}, 200);
|
||||
}
|
||||
},
|
||||
expectedFile: require.resolve('./expected.html')
|
||||
}
|
||||
];
|
||||
9
test/fixtures/async-templates/async-fragment-promise-error-bluebird/test.js
vendored
Normal file
9
test/fixtures/async-templates/async-fragment-promise-error-bluebird/test.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
var deferred = require('bluebird').defer();
|
||||
|
||||
setTimeout(function() {
|
||||
deferred.resolve({});
|
||||
}, 200);
|
||||
|
||||
exports.templateData = {
|
||||
promiseData: deferred.promise
|
||||
};
|
||||
1
test/fixtures/async-templates/async-fragment-promise-error-q/expected.html
vendored
Normal file
1
test/fixtures/async-templates/async-fragment-promise-error-q/expected.html
vendored
Normal file
@ -0,0 +1 @@
|
||||
BEFORE something went wrong!
|
||||
10
test/fixtures/async-templates/async-fragment-promise-error-q/template.marko
vendored
Normal file
10
test/fixtures/async-templates/async-fragment-promise-error-q/template.marko
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
<async-fragment data-provider="data.promiseData" var="promiseData">
|
||||
BEFORE
|
||||
<if test="true">
|
||||
$promiseData.noprop.value
|
||||
</if>
|
||||
AFTER
|
||||
<async-fragment-error>
|
||||
something went wrong!
|
||||
</async-fragment-error>
|
||||
</async-fragment>
|
||||
@ -1,4 +1,5 @@
|
||||
var deferred = require('raptor-promises').defer();
|
||||
|
||||
setTimeout(function() {
|
||||
deferred.resolve({});
|
||||
}, 200);
|
||||
Loading…
x
Reference in New Issue
Block a user