wa-lang.org/wazero@v1.0.2/internal/gojs/fs_test.go (about)

     1  package gojs_test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"wa-lang.org/wazero"
     7  	"wa-lang.org/wazero/internal/testing/require"
     8  )
     9  
    10  func Test_fs(t *testing.T) {
    11  	t.Parallel()
    12  
    13  	stdout, stderr, err := compileAndRun(testCtx, "fs", wazero.NewModuleConfig().WithFS(testFS))
    14  
    15  	require.EqualError(t, err, `module "" closed with exit_code(0)`)
    16  	require.Zero(t, stderr)
    17  	require.Equal(t, `TestFS ok
    18  wd ok
    19  Not a directory
    20  /test.txt ok
    21  test.txt ok
    22  contents: animals
    23  empty: 
    24  `, stdout)
    25  }