Skip to content

Commit 1043659

Browse files
committed
add possibility to inject gpio base path for testing purposes
1 parent 53625ab commit 1043659

File tree

5 files changed

+360
-316
lines changed

5 files changed

+360
-316
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
node_modules/
1+
/node_modules
2+
/test/data

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ var gpio4 = gpio.export(4, {
4242
// read or write to the header right away. Place your logic in this ready
4343
// function to guarantee everything will get fired properly
4444
ready: function() {
45-
}
45+
},
46+
47+
// To be able to test gpio-dependent code, you can set the gpio base path.
48+
// This way you can modify the gpio value in your test code.
49+
gpioBasePath: '/sys/class/gpio/'
4650
});
4751
```
4852

0 commit comments

Comments
 (0)