@@ -32,24 +32,27 @@ class EnvironmentTest : public EnvironmentTestFixture {
3232 }
3333};
3434
35- // TODO(codebytere): re-enable this test.
36- // TEST_F(EnvironmentTest, PreExeuctionPreparation) {
37- // const v8::HandleScope handle_scope(isolate_);
38- // const Argv argv;
39- // Env env {handle_scope, argv};
40-
41- // v8::Local<v8::Context> context = isolate_->GetCurrentContext();
42-
43- // const char* run_script = "process.argv0";
44- // v8::Local<v8::Script> script = v8::Script::Compile(
45- // context,
46- // v8::String::NewFromOneByte(isolate_,
47- // reinterpret_cast<const uint8_t*>(run_script),
48- // v8::NewStringType::kNormal).ToLocalChecked())
49- // .ToLocalChecked();
50- // v8::Local<v8::Value> result = script->Run(context).ToLocalChecked();
51- // CHECK(result->IsString());
52- // }
35+ TEST_F (EnvironmentTest, PreExecutionPreparation) {
36+ const v8::HandleScope handle_scope (isolate_);
37+ const Argv argv;
38+ Env env {handle_scope, argv};
39+
40+ node::LoadEnvironment (*env, [&](const node::StartExecutionCallbackInfo& info)
41+ -> v8::MaybeLocal<v8::Value> {
42+ return v8::Null (isolate_);
43+ });
44+
45+ v8::Local<v8::Context> context = isolate_->GetCurrentContext ();
46+ const char * run_script = " process.argv0" ;
47+ v8::Local<v8::Script> script = v8::Script::Compile (
48+ context,
49+ v8::String::NewFromOneByte (isolate_,
50+ reinterpret_cast <const uint8_t *>(run_script),
51+ v8::NewStringType::kNormal ).ToLocalChecked ())
52+ .ToLocalChecked ();
53+ v8::Local<v8::Value> result = script->Run (context).ToLocalChecked ();
54+ CHECK (result->IsString ());
55+ }
5356
5457TEST_F (EnvironmentTest, LoadEnvironmentWithCallback) {
5558 const v8::HandleScope handle_scope (isolate_);
0 commit comments