1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

Adding simple require functionality to js (#58)

* Adding simple require functionality to js

* comment
This commit is contained in:
Craig Peterson
2017-03-27 16:01:12 -06:00
committed by GitHub
parent b0333f3244
commit efb8e9bbf4
5 changed files with 45 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"os"
"path/filepath"
"testing"
"unicode"
"github.com/StackExchange/dnscontrol/models"
)
@ -25,7 +26,8 @@ func TestParsedFiles(t *testing.T) {
t.Fatal(err)
}
for _, f := range files {
if filepath.Ext(f.Name()) != ".js" {
//run all js files that start with a number. Skip others.
if filepath.Ext(f.Name()) != ".js" || !unicode.IsNumber(rune(f.Name()[0])) {
continue
}
t.Log(f.Name(), "------")