#!/bin/bash
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

set -e

"$FLOW" start --saved-state-fetcher none --wait

printf "find-module resolves package after init:\n"
assert_ok "$FLOW" find-module --strip-root foo test.js
echo

printf "check-contents resolves package after init:\n"
assert_ok "$FLOW" check-contents --strip-root test.js <<'EOF'
// @flow

import foo from 'foo';
foo as number;
EOF
echo

assert_ok "$FLOW" stop
