func TestFileSystemProviderNotExistPackage(t *testing.T) { t.Parallel() p := commonjs.NewFileSystemProvider(pkgrsrc.New("foo")) if _, err := p.Module("xyz"); err == nil { t.Fatal("did not find expected error") } }
func TestFileSystemProviderNotExistModule(t *testing.T) { t.Parallel() p := commonjs.NewFileSystemProvider( pkgrsrc.New("github.com/daaku/go.commonjs/_test")) if _, err := p.Module("xyz"); err == nil { t.Fatal("did not find expected error") } }
func TestFileSystemProvider(t *testing.T) { t.Parallel() const name = "b/baz" p := commonjs.NewFileSystemProvider( pkgrsrc.New("github.com/daaku/go.commonjs/_test")) m, err := p.Module(name) if err != nil { t.Fatal(err) } if m.Name() != name { t.Fatal("did not find expected name") } }