Skip to content

Commit a114ce2

Browse files
committed
add possibility to inject gpio base path for testing purposes
1 parent a8e3f5c commit a114ce2

File tree

5 files changed

+397
-353
lines changed

5 files changed

+397
-353
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)