[Pkg-javascript-commits] [node-lazy-property] 01/01: added tests
Saravanan Palanisamy
saravanan30erd-guest at moszumanska.debian.org
Fri Jul 14 15:41:39 UTC 2017
This is an automated email from the git hooks/post-receive script.
saravanan30erd-guest pushed a commit to branch master
in repository node-lazy-property.
commit 0ed409cb8ad825bfe1c22676c4ffa67650d88111
Author: saravanan30erd <saravanan30erd at gmail.com>
Date: Fri Jul 14 11:41:15 2017 -0400
added tests
---
.gitignore | 15 +++++++++++++++
debian/control | 1 +
debian/rules | 3 ++-
debian/tests/control | 3 +++
test/test.js | 20 ++++++++++++++++++++
5 files changed, 41 insertions(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0d1b0b0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,15 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+npm-debug.log
+node_modules/*
\ No newline at end of file
diff --git a/debian/control b/debian/control
index 3af7379..2bae268 100644
--- a/debian/control
+++ b/debian/control
@@ -7,6 +7,7 @@ Build-Depends:
debhelper (>= 9)
, dh-buildinfo
, nodejs
+ , tape
Standards-Version: 4.0.0
Homepage: https://github.com/mikolalysenko/lazy-property
Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/node-lazy-property.git
diff --git a/debian/rules b/debian/rules
index de57af0..c03d0c5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,7 +9,8 @@
#override_dh_auto_build:
-#override_dh_auto_test:
+override_dh_auto_test:
+ tape test/*.js
diff --git a/debian/tests/control b/debian/tests/control
index dbe74a5..08cca7c 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,2 +1,5 @@
Tests: require
Depends: node-lazy-property
+
+Test-Command: tape test/*.js
+Depends: @, tape
diff --git a/test/test.js b/test/test.js
new file mode 100644
index 0000000..4950ad2
--- /dev/null
+++ b/test/test.js
@@ -0,0 +1,20 @@
+var tape = require("tape")
+var addLazyProperty = require("../lazyProperty.js")
+
+tape("lazy-property", function(t) {
+ var obj = {}
+ var count = 0
+
+ addLazyProperty(obj, "foo", function() {
+ ++count
+ return "bar"
+ })
+
+ t.same(count, 0)
+ t.same(obj.foo, "bar")
+ t.same(count, 1)
+ t.same(obj.foo, "bar")
+ t.same(count, 1)
+
+ t.end()
+})
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-lazy-property.git
More information about the Pkg-javascript-commits
mailing list